mirror of
https://github.com/django/django.git
synced 2025-08-03 10:34:04 +00:00
Expurged INSTALLED_APPS from code and tests.
Except the app cache code and a few specific tests, of course.
This commit is contained in:
parent
9cdf1f6d54
commit
2239081ff1
5 changed files with 33 additions and 35 deletions
|
@ -9,7 +9,7 @@ from django.core.apps import app_cache
|
|||
from django.core.validators import RegexValidator, EmailValidator
|
||||
from django.db import models, migrations
|
||||
from django.db.migrations.writer import MigrationWriter
|
||||
from django.test import TestCase, override_settings
|
||||
from django.test import TestCase
|
||||
from django.utils import six
|
||||
from django.utils.deconstruct import deconstructible
|
||||
from django.utils.translation import ugettext_lazy as _
|
||||
|
@ -122,10 +122,9 @@ class WriterTests(TestCase):
|
|||
|
||||
base_dir = os.path.dirname(os.path.dirname(__file__))
|
||||
|
||||
with override_settings(INSTALLED_APPS=test_apps):
|
||||
for app in test_apps:
|
||||
with app_cache._with_app(app):
|
||||
migration = migrations.Migration('0001_initial', app.split('.')[-1])
|
||||
expected_path = os.path.join(base_dir, *(app.split('.') + ['migrations', '0001_initial.py']))
|
||||
writer = MigrationWriter(migration)
|
||||
self.assertEqual(writer.path, expected_path)
|
||||
for app in test_apps:
|
||||
with app_cache._with_app(app):
|
||||
migration = migrations.Migration('0001_initial', app.split('.')[-1])
|
||||
expected_path = os.path.join(base_dir, *(app.split('.') + ['migrations', '0001_initial.py']))
|
||||
writer = MigrationWriter(migration)
|
||||
self.assertEqual(writer.path, expected_path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue