mirror of
https://github.com/django/django.git
synced 2025-08-03 18:38:50 +00:00
Replaced ad-hoc caching of get_models with lru_cache.
Invalidate properly the cache whenever all_models or app_configs change. This fixes some isolation issues in the test suite.
This commit is contained in:
parent
2ec8e3443b
commit
82a35e24d4
8 changed files with 15 additions and 27 deletions
|
@ -175,7 +175,7 @@ class ProxyModelTests(TestCase):
|
|||
finally:
|
||||
app_cache.app_configs['proxy_models'].models = _old_models
|
||||
app_cache.all_models['proxy_models'] = _old_models
|
||||
app_cache._get_models_cache = {}
|
||||
app_cache.get_models.cache_clear()
|
||||
|
||||
def test_myperson_manager(self):
|
||||
Person.objects.create(name="fred")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue