mirror of
https://github.com/django/django.git
synced 2025-07-24 13:44:32 +00:00
Renamed AppCache to Apps.
Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
This commit is contained in:
parent
e9e522a8e7
commit
1716b7ce5a
92 changed files with 491 additions and 487 deletions
|
@ -80,13 +80,13 @@ def get_test_modules():
|
|||
|
||||
|
||||
def get_installed():
|
||||
from django.apps import app_cache
|
||||
return [app_config.name for app_config in app_cache.get_app_configs()]
|
||||
from django.apps import apps
|
||||
return [app_config.name for app_config in apps.get_app_configs()]
|
||||
|
||||
|
||||
def setup(verbosity, test_labels):
|
||||
import django
|
||||
from django.apps import app_cache, AppConfig
|
||||
from django.apps import apps, AppConfig
|
||||
from django.conf import settings
|
||||
from django.test import TransactionTestCase, TestCase
|
||||
|
||||
|
@ -128,7 +128,7 @@ def setup(verbosity, test_labels):
|
|||
# Load all the ALWAYS_INSTALLED_APPS.
|
||||
with warnings.catch_warnings():
|
||||
warnings.filterwarnings('ignore', 'django.contrib.comments is deprecated and will be removed before Django 1.8.', DeprecationWarning)
|
||||
app_cache.populate_models()
|
||||
apps.populate_models()
|
||||
|
||||
# Load all the test model apps.
|
||||
test_modules = get_test_modules()
|
||||
|
@ -168,9 +168,9 @@ def setup(verbosity, test_labels):
|
|||
if module_label not in settings.INSTALLED_APPS:
|
||||
settings.INSTALLED_APPS.append(module_label)
|
||||
app_config = AppConfig.create(module_label)
|
||||
app_config.import_models(app_cache.all_models[app_config.label])
|
||||
app_cache.app_configs[app_config.label] = app_config
|
||||
app_cache.get_models.cache_clear()
|
||||
app_config.import_models(apps.all_models[app_config.label])
|
||||
apps.app_configs[app_config.label] = app_config
|
||||
apps.get_models.cache_clear()
|
||||
|
||||
return state
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue