summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2014-06-16 15:59:24 -0400
committerTim Graham <timograham@gmail.com>2014-06-16 16:21:37 -0400
commitb341f33697cdd26cc967c2ca4a0ac679f4167319 (patch)
tree3c4879507e0a999209f2b064e206954906c74bfa /tests
parenta96dbda6d35d33f77293b595a6506a600261f17c (diff)
Added database migration for contrib.auth.
refs #22170.
Diffstat (limited to 'tests')
-rw-r--r--tests/migrations/test_loader.py6
-rwxr-xr-xtests/runtests.py5
-rw-r--r--tests/urlpatterns_reverse/tests.py2
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 4c63415abf..656dfcebe4 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -129,8 +129,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 ebe04393df..d2840a0037 100644
--- a/tests/urlpatterns_reverse/tests.py
+++ b/tests/urlpatterns_reverse/tests.py
@@ -325,7 +325,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)