diff options
| author | Tim Graham <timograham@gmail.com> | 2014-06-16 13:28:03 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-06-16 15:03:27 -0400 |
| commit | a0bf14a2accb75987657a9656bccfc8b9df8d375 (patch) | |
| tree | b1444cd0a337675ba8b6ab9740833f63af892d13 /tests | |
| parent | 02860e779c7a93e50817df55d8a7f64b642319eb (diff) | |
[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
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/migrations/test_loader.py | 2 | ||||
| -rwxr-xr-x | tests/runtests.py | 5 |
2 files changed, 6 insertions, 1 deletions
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 |
