Fix test running with new apps stuff/migrate actually running migrations

This commit is contained in:
Andrew Godwin 2013-06-19 15:36:02 +01:00
parent 9daf81b94e
commit 2ae8a8a77d
8 changed files with 33 additions and 12 deletions

View file

@ -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.

View file

@ -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,

View file

@ -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 -

View file

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