summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Charette <charette.s@gmail.com>2016-01-25 14:27:35 -0500
committerSimon Charette <charette.s@gmail.com>2016-01-25 22:02:45 -0500
commitabdbf00815ae8f49247082528d02a3d0890785a9 (patch)
tree92f0026826112c16994b008f9a5e14c0ddf9c185 /tests
parent3306106fb1ce610e0961ce319a98e33c93795c1f (diff)
[1.9.x] Fixed #26135 -- Adjusted the migration questioner's handling of disabled apps.
This was causing an issue when calling the `migrate` command in a test case with the `available_apps` attribute pointing to an application with migrations disabled using the `MIGRATION_MODULES` setting. Thanks to Tim Graham for the review. Refs #24919 Backport of 4dcaa5871b70859952c6f9c437dfe1b5f10509f2 from master
Diffstat (limited to 'tests')
-rw-r--r--tests/migrations/test_questioner.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/migrations/test_questioner.py b/tests/migrations/test_questioner.py
new file mode 100644
index 0000000000..d5ba18a684
--- /dev/null
+++ b/tests/migrations/test_questioner.py
@@ -0,0 +1,15 @@
+from __future__ import unicode_literals
+
+from django.db.migrations.questioner import MigrationQuestioner
+from django.test import SimpleTestCase
+from django.test.utils import override_settings
+
+
+class QuestionerTests(SimpleTestCase):
+ @override_settings(
+ INSTALLED_APPS=['migrations'],
+ MIGRATION_MODULES={'migrations': None},
+ )
+ def test_ask_initial_with_disabled_migrations(self):
+ questioner = MigrationQuestioner()
+ self.assertIs(False, questioner.ask_initial('migrations'))