mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
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.
This commit is contained in:
parent
334551339d
commit
8662654d6d
55 changed files with 226 additions and 220 deletions
|
@ -2,7 +2,7 @@ from __future__ import unicode_literals
|
|||
|
||||
from django.utils.six import StringIO
|
||||
|
||||
from django.apps.cache import cache
|
||||
from django.apps import app_cache
|
||||
from django.contrib.auth.models import Permission
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
from django.core import management
|
||||
|
@ -23,12 +23,12 @@ class SwappableModelTests(TestCase):
|
|||
def setUp(self):
|
||||
# This test modifies the installed apps, so we need to make sure
|
||||
# we're not dealing with a cached app list.
|
||||
cache._get_models_cache.clear()
|
||||
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.
|
||||
cache._get_models_cache.clear()
|
||||
app_cache._get_models_cache.clear()
|
||||
|
||||
@override_settings(TEST_ARTICLE_MODEL='swappable_models.AlternateArticle')
|
||||
def test_generated_data(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue