File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -241,6 +241,7 @@ def test_data_types(self):
241241 def test_data_types_unsafe_rejected (self ):
242242 # Arbitrary functions and classes are blocked by SafeUnpickler (CVE-2025-69872)
243243 from diskcache .core import UnpicklingError
244+
244245 cache .set ('fn' , f )
245246 with self .assertRaises (UnpicklingError ):
246247 cache .get ('fn' )
@@ -252,6 +253,7 @@ def test_cache_read_for_model_instance(self):
252253 # Django model instances use django.db.models.base.model_unpickle which
253254 # is not in the SafeUnpickler allowlist (CVE-2025-69872).
254255 from diskcache .core import UnpicklingError
256+
255257 expensive_calculation .num_runs = 0
256258 Poll .objects .all ().delete ()
257259 my_poll = Poll .objects .create (question = 'Well?' )
@@ -276,6 +278,7 @@ def test_cache_read_for_model_instance_with_deferred(self):
276278 # Deferred querysets reference user model classes not in the SafeUnpickler
277279 # allowlist (CVE-2025-69872).
278280 from diskcache .core import UnpicklingError
281+
279282 expensive_calculation .num_runs = 0
280283 Poll .objects .all ().delete ()
281284 Poll .objects .create (question = 'What?' )
You can’t perform that action at this time.
0 commit comments