diff options
| author | Andrew Godwin <andrew@aeracode.org> | 2013-06-19 15:36:02 +0100 |
|---|---|---|
| committer | Andrew Godwin <andrew@aeracode.org> | 2013-06-19 15:36:02 +0100 |
| commit | 2ae8a8a77d6968a155db9b17ba13e21d91bd351b (patch) | |
| tree | 0c80bd99e5c94328fab493a21f30bd61e992c565 /tests | |
| parent | 9daf81b94e7945d7adfdf62206cf9cb436166f0d (diff) | |
Fix test running with new apps stuff/migrate actually running migrations
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/migrations/test_executor.py | 4 | ||||
| -rw-r--r-- | tests/migrations/test_loader.py | 6 | ||||
| -rw-r--r-- | tests/migrations/test_operations.py | 4 | ||||
| -rw-r--r-- | tests/migrations/test_writer.py | 4 |
4 files changed, 12 insertions, 6 deletions
diff --git a/tests/migrations/test_executor.py b/tests/migrations/test_executor.py index 629c47de56..c426defe4a 100644 --- a/tests/migrations/test_executor.py +++ b/tests/migrations/test_executor.py @@ -1,4 +1,5 @@ from django.test import TransactionTestCase +from django.test.utils import override_settings from django.db import connection from django.db.migrations.executor import MigrationExecutor @@ -11,6 +12,9 @@ class ExecutorTests(TransactionTestCase): test failures first, as they may be propagating into here. """ + available_apps = ["migrations"] + + @override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations"}) def test_run(self): """ Tests running a simple set of migrations. diff --git a/tests/migrations/test_loader.py b/tests/migrations/test_loader.py index 9318f77004..255efe9cfb 100644 --- a/tests/migrations/test_loader.py +++ b/tests/migrations/test_loader.py @@ -1,4 +1,5 @@ -from django.test import TestCase, TransactionTestCase +from django.test import TestCase +from django.test.utils import override_settings from django.db import connection from django.db.migrations.loader import MigrationLoader from django.db.migrations.recorder import MigrationRecorder @@ -30,12 +31,13 @@ class RecorderTests(TestCase): ) -class LoaderTests(TransactionTestCase): +class LoaderTests(TestCase): """ Tests the disk and database loader, and running through migrations in memory. """ + @override_settings(MIGRATION_MODULES={"migrations": "migrations.test_migrations"}) def test_load(self): """ Makes sure the loader can load the migrations for the test apps, diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py index 9c25e43990..fc5aa47faf 100644 --- a/tests/migrations/test_operations.py +++ b/tests/migrations/test_operations.py @@ -1,9 +1,9 @@ -from django.test import TransactionTestCase +from django.test import TestCase from django.db import connection, models, migrations from django.db.migrations.state import ProjectState -class OperationTests(TransactionTestCase): +class OperationTests(TestCase): """ Tests running the operations and making sure they do what they say they do. Each test looks at their state changing, and then their database operation - diff --git a/tests/migrations/test_writer.py b/tests/migrations/test_writer.py index c6ca100c1a..22925fee9b 100644 --- a/tests/migrations/test_writer.py +++ b/tests/migrations/test_writer.py @@ -1,12 +1,12 @@ # encoding: utf8 import datetime from django.utils import six -from django.test import TransactionTestCase +from django.test import TestCase from django.db.migrations.writer import MigrationWriter from django.db import models, migrations -class WriterTests(TransactionTestCase): +class WriterTests(TestCase): """ Tests the migration writer (makes migration files from Migration instances) """ |
