summaryrefslogtreecommitdiff
path: root/tests/migrations
diff options
context:
space:
mode:
authorAymeric Augustin <aymeric.augustin@m4x.org>2013-12-18 17:56:11 +0100
committerAymeric Augustin <aymeric.augustin@m4x.org>2013-12-22 11:39:17 +0100
commitf25fa9d8590c7759c1ec7ffecf1d67be81237674 (patch)
treec0a4a40a5371ad8e0d1c1af8c04295e874170041 /tests/migrations
parent439b364e1e81371bd87488beed35ce051be8aaaa (diff)
Deprecated load_app().
Adjusted several tests that used it to add apps to the app cache and then attempted to remove them by manipulating attributes directly. Also renamed invalid_models to invalid_models_tests to avoid clashing application labels between the outer and the inner invalid_models applications.
Diffstat (limited to 'tests/migrations')
-rw-r--r--tests/migrations/test_writer.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/migrations/test_writer.py b/tests/migrations/test_writer.py
index 76fe5b5a9e..f921f9f03c 100644
--- a/tests/migrations/test_writer.py
+++ b/tests/migrations/test_writer.py
@@ -124,8 +124,8 @@ class WriterTests(TestCase):
with override_settings(INSTALLED_APPS=test_apps):
for app in test_apps:
- app_cache.load_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)
+ 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)