summaryrefslogtreecommitdiff
path: root/tests/swappable_models
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-24 10:08:04 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-24 10:56:50 +0100
commit82a35e24d4de58e637661591b14d9b4658bcab11 (patch)
treee0dabcce9d37651b59f478907778bda547f9cf76 /tests/swappable_models
parent2ec8e3443bc9345d986710244e05a3cce56c8da1 (diff)
downloaddjango-82a35e24d4de58e637661591b14d9b4658bcab11.tar.gz
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.
Diffstat (limited to 'tests/swappable_models')
-rw-r--r--tests/swappable_models/tests.py10
1 files changed, 0 insertions, 10 deletions
diff --git a/tests/swappable_models/tests.py b/tests/swappable_models/tests.py
index cdebbef374..c703a99fcb 100644
--- a/tests/swappable_models/tests.py
+++ b/tests/swappable_models/tests.py
@@ -19,16 +19,6 @@ class SwappableModelTests(TestCase):
'django.contrib.contenttypes',
]
- def setUp(self):
- # This test modifies the installed apps, so we need to make sure
- # we're not dealing with a cached app list.
- app_cache._get_models_cache.clear()
-
- def tearDown(self):
- # By fiddling with swappable models, we alter the installed models
- # cache, so flush it to make sure there are no side effects.
- app_cache._get_models_cache.clear()
-
@override_settings(TEST_ARTICLE_MODEL='swappable_models.AlternateArticle')
def test_generated_data(self):
"Permissions and content types are not created for a swapped model"