Opened 13 years ago
Closed 13 years ago
#20092 closed Bug (duplicate)
Cache not isolated in tests
| Reported by: | Jonas Obrist | Owned by: | nobody | 
|---|---|---|---|
| Component: | Testing framework | Version: | 1.5 | 
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
Unlike the database, cache is not isolated in tests. I would argue that it's expected behavior that the cache is clean in each test method.
The cache tests of Django [1] manually clear the cache in tearDown and comparing the DB cache tests [2] to the Locmem cache tests [3] shows possible difficulties on properly isolating the cache in tests.
[1] https://github.com/django/django/blob/master/tests/cache/tests.py
[2] https://github.com/django/django/blob/master/tests/cache/tests.py#L814
[3] https://github.com/django/django/blob/master/tests/cache/tests.py#L917
This seems like a duplicate of #11505.