summaryrefslogtreecommitdiff
path: root/tests/proxy_models/tests.py
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-11 23:31:34 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-17 10:17:44 +0100
commit8662654d6d50e4d89f771a757ae5fc83c6b74db0 (patch)
tree1b9d98842d25a5d15a389bcc0dcefdc4fcffef4f /tests/proxy_models/tests.py
parent334551339de38569ac3530886e3f9cc681190224 (diff)
Removed module-level functions for the app cache.
Since the original ones in django.db.models.loading were kept only for backwards compatibility, there's no need to recreate them. However, many internals of Django still relied on them. They were also imported in django.db.models. They never appear in the documentation, except a quick mention of get_models and get_app in the 1.2 release notes to document an edge case in GIS. I don't think that makes them a public API. This commit doesn't change the overall amount of global state but clarifies that it's tied to the app_cache object instead of hiding it behind half a dozen functions.
Diffstat (limited to 'tests/proxy_models/tests.py')
-rw-r--r--tests/proxy_models/tests.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/proxy_models/tests.py b/tests/proxy_models/tests.py
index 5b9433bbf7..cdd979a399 100644
--- a/tests/proxy_models/tests.py
+++ b/tests/proxy_models/tests.py
@@ -1,7 +1,7 @@
from __future__ import unicode_literals
import copy
-from django.apps.cache import cache
+from django.apps import app_cache
from django.contrib import admin
from django.contrib.contenttypes.models import ContentType
from django.core import management
@@ -159,7 +159,7 @@ class ProxyModelTests(TestCase):
# This test adds dummy applications to the app cache. These
# need to be removed in order to prevent bad interactions
# with the flush operation in other tests.
- old_app_models = copy.deepcopy(cache.app_models)
+ old_app_models = copy.deepcopy(app_cache.app_models)
class SwappableModel(models.Model):
@@ -176,7 +176,7 @@ class ProxyModelTests(TestCase):
class Meta:
proxy = True
finally:
- cache.app_models = old_app_models
+ app_cache.app_models = old_app_models
def test_myperson_manager(self):
Person.objects.create(name="fred")