Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Account for Django cache culling probability.
  • Loading branch information
tim-schilling committed Jun 14, 2026
commit 198304a1ba3f993b5d812cdd31212a6d3200e5d8
1 change: 1 addition & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Pending
needing to respect ``django.conf.settings.DEBUG`` to match
``debug_toolbar_urls``.
* Fixed cookie ``expires`` calculation in ``djdt.cookie.set``.
* Account for the new ``CULL_PROBABILITY`` in Django 6.2 in tests.

6.3.0 (2026-04-01)
------------------
Expand Down
10 changes: 3 additions & 7 deletions tests/test_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ def test_cache_store_operations_not_tracked_by_cache_panel(self):
"ddt_db_cache": {
"BACKEND": "django.core.cache.backends.db.DatabaseCache",
"LOCATION": "test_cache_store_table",
# Force the culling to occur on all writes in Django
"OPTIONS": {"CULL_PROBABILITY": 1},
}
},
)
Expand Down Expand Up @@ -483,12 +485,6 @@ def test_database_backend_can_be_tracked_by_sql_panel(self):
for q in sql_panel._queries[initial_query_count:]
if "test_cache_store_table" in q.get("sql", "").lower()
]

self.assertEqual(
len(cache_queries),
4,
f"CacheStore DatabaseCache operations be tracked by SQLPanel, "
f"but found {len(cache_queries)} queries to 'test_cache_store_table' table",
)
self.assertEqual(len(cache_queries), 4)
finally:
sql_panel.disable_instrumentation()