1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Added database migration for contrib.auth.

refs #22170.
This commit is contained in:
Tim Graham
2014-06-16 15:59:24 -04:00
parent a96dbda6d3
commit b341f33697
5 changed files with 75 additions and 4 deletions

View File

@@ -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"),
],
)