mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +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:
@@ -136,7 +136,7 @@ class MakeMigrationsTests(MigrationTestBase):
|
||||
def tearDown(self):
|
||||
app_cache.app_configs['migrations'].models = self._old_models
|
||||
app_cache.all_models['migrations'] = self._old_models
|
||||
app_cache._get_models_cache = {}
|
||||
app_cache.get_models.cache_clear()
|
||||
|
||||
os.chdir(self.test_dir)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user