diff options
| author | Tim Graham <timograham@gmail.com> | 2014-06-16 15:59:24 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-06-16 16:23:28 -0400 |
| commit | d36b54d753a1fb79f32f6b7a91d582bccb7ab311 (patch) | |
| tree | 6df4fb40d8172ae337e885361810aafd96fe4337 /tests | |
| parent | 6a937cc0a4b0aa36380b5e6cbbccedcbb350a115 (diff) | |
[1.7.x] Added database migration for contrib.auth.
refs #22170.
Backport of b341f33697 from master
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/migrations/test_loader.py | 6 | ||||
| -rwxr-xr-x | tests/runtests.py | 5 | ||||
| -rw-r--r-- | tests/urlpatterns_reverse/tests.py | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/tests/migrations/test_loader.py b/tests/migrations/test_loader.py index e03873a1ea..78cde79a31 100644 --- a/tests/migrations/test_loader.py +++ b/tests/migrations/test_loader.py @@ -4,6 +4,7 @@ from django.test import TestCase, override_settings from django.db import connection, connections from django.db.migrations.loader import MigrationLoader, AmbiguityError from django.db.migrations.recorder import MigrationRecorder +from django.test import modify_settings from django.utils import six @@ -46,6 +47,7 @@ class LoaderTests(TestCase): """ @override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations"}) + @modify_settings(INSTALLED_APPS={'append': 'basic'}) def test_load(self): """ Makes sure the loader can load the migrations for the test apps, @@ -77,7 +79,7 @@ class LoaderTests(TestCase): ) # Ensure we've included unmigrated apps in there too - self.assertIn("auth", project_state.real_apps) + self.assertIn("basic", project_state.real_apps) @override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations_unmigdep"}) def test_load_unmigrated_dependency(self): @@ -89,6 +91,8 @@ class LoaderTests(TestCase): self.assertEqual( migration_loader.graph.forwards_plan(("migrations", "0001_initial")), [ + ('contenttypes', u'0001_initial'), + ('auth', u'0001_initial'), ("migrations", "0001_initial"), ], ) diff --git a/tests/runtests.py b/tests/runtests.py index c1772ca69b..87b7c3ea65 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -130,8 +130,9 @@ def setup(verbosity, test_labels): # Ensure the middleware classes are seen as overridden otherwise we get a compatibility warning. settings._explicit_settings.add('MIDDLEWARE_CLASSES') settings.MIGRATION_MODULES = { - # this module doesn't actually exist, but this lets us skip creating - # migrations for the test modules for some reason. + # these 'tests.migrations' modules don't actually exist, but this lets + # us skip creating migrations for the test models. + 'auth': 'django.contrib.auth.tests.migrations', 'contenttypes': 'django.contrib.contenttypes.tests.migrations', } diff --git a/tests/urlpatterns_reverse/tests.py b/tests/urlpatterns_reverse/tests.py index 512f551a1d..6d197534e4 100644 --- a/tests/urlpatterns_reverse/tests.py +++ b/tests/urlpatterns_reverse/tests.py @@ -322,7 +322,7 @@ LOGIN_URL = reverse_lazy('login')""") self.remove_settings('settings.py') def test_lazy_in_settings(self): - out, err = self.run_manage(['sqlall', 'auth']) + out, err = self.run_manage(['validate']) self.assertNoOutput(err) |
