summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarten Kenbeek <marten.knbk@gmail.com>2015-05-24 21:17:39 +0200
committerTim Graham <timograham@gmail.com>2015-05-25 13:56:37 -0400
commit1ac4c7d415750ddc648cbf888bc2fbcde933f799 (patch)
tree2fc32e367b57db1fe3773f246d436e1053afc8f3 /tests
parent122e688a9c2fa71f47f13f134ab18cf5ea668e7a (diff)
[1.8.x] Fixed #24848 -- Fixed ValueError for faulty migrations module.
Added apps to unmigrated apps if the migrations module is a file or a folder missing __init__.py. Thanks to Ernest0x for the bug report. Backport of d73176a84273c06fa11075c65293ec28497a8423 from master
Diffstat (limited to 'tests')
-rw-r--r--tests/migrations/test_loader.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/migrations/test_loader.py b/tests/migrations/test_loader.py
index b189da0721..070ca2a86c 100644
--- a/tests/migrations/test_loader.py
+++ b/tests/migrations/test_loader.py
@@ -164,12 +164,20 @@ class LoaderTests(TestCase):
def test_load_module_file(self):
with override_settings(MIGRATION_MODULES={"migrations": "migrations.faulty_migrations.file"}):
- MigrationLoader(connection)
+ loader = MigrationLoader(connection)
+ self.assertIn(
+ "migrations", loader.unmigrated_apps,
+ "App with migrations module file not in unmigrated apps."
+ )
@skipIf(six.PY2, "PY2 doesn't load empty dirs.")
def test_load_empty_dir(self):
with override_settings(MIGRATION_MODULES={"migrations": "migrations.faulty_migrations.namespace"}):
- MigrationLoader(connection)
+ loader = MigrationLoader(connection)
+ self.assertIn(
+ "migrations", loader.unmigrated_apps,
+ "App missing __init__.py in migrations module not in unmigrated apps."
+ )
@override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations_squashed"})
def test_loading_squashed(self):