From eb8600a65673649ea15ed18d17127f741807ac8b Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 16 Jun 2014 13:28:03 -0400 Subject: Added database migration for contrib.contenttypes. Moved contenttypes tests to allow them to run correctly in the presence of migrations. refs #22170. --- 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 c084f2590b..4c63415abf 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -128,6 +128,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