From a0bf14a2accb75987657a9656bccfc8b9df8d375 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 16 Jun 2014 13:28:03 -0400 Subject: [1.7.x] Added database migration for contrib.contenttypes. Moved contenttypes tests to allow them to run correctly in the presence of migrations. refs #22170. Backport of eb8600a656 from master --- tests/migrations/test_loader.py | 2 +- tests/runtests.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/migrations/test_loader.py b/tests/migrations/test_loader.py index 4c1e2d239c..e03873a1ea 100644 --- a/tests/migrations/test_loader.py +++ b/tests/migrations/test_loader.py @@ -77,7 +77,7 @@ class LoaderTests(TestCase): ) # Ensure we've included unmigrated apps in there too - self.assertIn("contenttypes", project_state.real_apps) + self.assertIn("auth", project_state.real_apps) @override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations_unmigdep"}) def test_load_unmigrated_dependency(self): diff --git a/tests/runtests.py b/tests/runtests.py index 53d754be07..c1772ca69b 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -129,6 +129,11 @@ def setup(verbosity, test_labels): settings.MIDDLEWARE_CLASSES = ALWAYS_MIDDLEWARE_CLASSES # 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. + 'contenttypes': 'django.contrib.contenttypes.tests.migrations', + } if verbosity > 0: # Ensure any warnings captured to logging are piped through a verbose -- cgit v1.3