summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-29 21:24:40 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-29 21:25:28 +0100
commit38ce41103fecf58418163b19403608988a291b56 (patch)
treecffc9d2a26fff2ad79c24f0d7b63694f58499d0b /tests
parent8cfcd801c4b2e6402c1c814f64db99a5b7501170 (diff)
Used Apps.clear_cache() in tests that alter the app registry.
Diffstat (limited to 'tests')
-rw-r--r--tests/app_loading/tests.py2
-rw-r--r--tests/managers_regress/tests.py6
-rw-r--r--tests/migrations/test_commands.py2
-rw-r--r--tests/proxy_models/tests.py2
-rwxr-xr-xtests/runtests.py2
-rw-r--r--tests/tablespaces/tests.py2
6 files changed, 8 insertions, 8 deletions
diff --git a/tests/app_loading/tests.py b/tests/app_loading/tests.py
index fddf75f30e..5219b5315d 100644
--- a/tests/app_loading/tests.py
+++ b/tests/app_loading/tests.py
@@ -21,7 +21,7 @@ class EggLoadingTest(TestCase):
def tearDown(self):
apps.all_models['app_loading'] = self._old_models
- apps.get_models.cache_clear()
+ apps.clear_cache()
sys.path = self.old_path
diff --git a/tests/managers_regress/tests.py b/tests/managers_regress/tests.py
index 8e0b4cd017..0d24873a10 100644
--- a/tests/managers_regress/tests.py
+++ b/tests/managers_regress/tests.py
@@ -128,7 +128,7 @@ class ManagersRegressionTests(TestCase):
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 ManagersRegressionTests(TestCase):
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 ManagersRegressionTests(TestCase):
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()
diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py
index 3219a62f5a..e53b26c638 100644
--- a/tests/migrations/test_commands.py
+++ b/tests/migrations/test_commands.py
@@ -136,7 +136,7 @@ class MakeMigrationsTests(MigrationTestBase):
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:
diff --git a/tests/proxy_models/tests.py b/tests/proxy_models/tests.py
index fe294aeb1e..0f2b5349be 100644
--- a/tests/proxy_models/tests.py
+++ b/tests/proxy_models/tests.py
@@ -175,7 +175,7 @@ class ProxyModelTests(TestCase):
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")
diff --git a/tests/runtests.py b/tests/runtests.py
index 3998a7bf92..4c917fbbed 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -168,7 +168,7 @@ def setup(verbosity, test_labels):
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
diff --git a/tests/tablespaces/tests.py b/tests/tablespaces/tests.py
index 5e22608551..8c69e70a19 100644
--- a/tests/tablespaces/tests.py
+++ b/tests/tablespaces/tests.py
@@ -37,7 +37,7 @@ class TablespacesTests(TestCase):
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)