Expurged INSTALLED_APPS from code and tests.

Except the app cache code and a few specific tests, of course.
This commit is contained in:
Aymeric Augustin 2013-12-19 22:33:46 +01:00
parent 9cdf1f6d54
commit 2239081ff1
5 changed files with 33 additions and 35 deletions

View file

@ -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)