Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Used Apps.clear_cache() in tests that alter the app registry.

  • Loading branch information...
commit 38ce41103fecf58418163b19403608988a291b56 1 parent 8cfcd80
@aaugustin aaugustin authored
View
2  tests/app_loading/tests.py
@@ -21,7 +21,7 @@ def setUp(self):
def tearDown(self):
apps.all_models['app_loading'] = self._old_models
- apps.get_models.cache_clear()
+ apps.clear_cache()
sys.path = self.old_path
View
6 tests/managers_regress/tests.py
@@ -128,7 +128,7 @@ class Meta:
finally:
apps.app_configs['managers_regress'].models = _old_models
apps.all_models['managers_regress'] = _old_models
- apps.get_models.cache_clear()
+ apps.clear_cache()
@override_settings(TEST_SWAPPABLE_MODEL='managers_regress.Parent')
def test_custom_swappable_manager(self):
@@ -156,7 +156,7 @@ class Meta:
finally:
apps.app_configs['managers_regress'].models = _old_models
apps.all_models['managers_regress'] = _old_models
- apps.get_models.cache_clear()
+ apps.clear_cache()
@override_settings(TEST_SWAPPABLE_MODEL='managers_regress.Parent')
def test_explicit_swappable_manager(self):
@@ -184,7 +184,7 @@ class Meta:
finally:
apps.app_configs['managers_regress'].models = _old_models
apps.all_models['managers_regress'] = _old_models
- apps.get_models.cache_clear()
+ apps.clear_cache()
def test_regress_3871(self):
related = RelatedModel.objects.create()
View
2  tests/migrations/test_commands.py
@@ -136,7 +136,7 @@ def setUp(self):
def tearDown(self):
apps.app_configs['migrations'].models = self._old_models
apps.all_models['migrations'] = self._old_models
- apps.get_models.cache_clear()
+ apps.clear_cache()
os.chdir(self.test_dir)
try:
View
2  tests/proxy_models/tests.py
@@ -175,7 +175,7 @@ class Meta:
finally:
apps.app_configs['proxy_models'].models = _old_models
apps.all_models['proxy_models'] = _old_models
- apps.get_models.cache_clear()
+ apps.clear_cache()
def test_myperson_manager(self):
Person.objects.create(name="fred")
View
2  tests/runtests.py
@@ -168,7 +168,7 @@ def no_available_apps(self):
app_config = AppConfig.create(module_label)
app_config.import_models(apps.all_models[app_config.label])
apps.app_configs[app_config.label] = app_config
- apps.get_models.cache_clear()
+ apps.clear_cache()
return state
View
2  tests/tablespaces/tests.py
@@ -37,7 +37,7 @@ def tearDown(self):
apps.app_configs['tablespaces'].models = self._old_models
apps.all_models['tablespaces'] = self._old_models
- apps.get_models.cache_clear()
+ apps.clear_cache()
def assertNumContains(self, haystack, needle, count):
real_count = haystack.count(needle)
Please sign in to comment.
Something went wrong with that request. Please try again.