summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-09-28 10:04:52 -0400
committerGitHub <noreply@github.com>2016-09-28 10:04:52 -0400
commita44fc008c4e38fadef04021fdba564949f1aee3a (patch)
tree2645fa7b9beca798521b666fbecab31727a26d67 /tests
parent9e07a9b5feb30fe06fb23d0e77edd34f6c3f92b5 (diff)
Fixed #27217 -- Fixed crash in CreateModel optimization with models that use mixins.
Thanks Simon Charette for review.
Diffstat (limited to 'tests')
-rw-r--r--tests/migrations/test_operations.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py
index 5f96043e53..553ed58ea4 100644
--- a/tests/migrations/test_operations.py
+++ b/tests/migrations/test_operations.py
@@ -4,11 +4,12 @@ import unittest
from django.db import connection, migrations, models, transaction
from django.db.migrations.migration import Migration
+from django.db.migrations.operations import CreateModel
from django.db.migrations.state import ProjectState
from django.db.models.fields import NOT_PROVIDED
from django.db.transaction import atomic
from django.db.utils import IntegrityError
-from django.test import override_settings, skipUnlessDBFeature
+from django.test import SimpleTestCase, override_settings, skipUnlessDBFeature
from .models import FoodManager, FoodQuerySet, UnicodeModel
from .test_base import MigrationTestBase
@@ -2414,3 +2415,9 @@ class SwappableOperationTests(OperationTestBase):
with connection.schema_editor() as editor:
operation.database_forwards('test_rminigsw', editor, project_state, new_state)
operation.database_backwards('test_rminigsw', editor, new_state, project_state)
+
+
+class TestCreateModel(SimpleTestCase):
+
+ def test_references_model_mixin(self):
+ CreateModel('name', [], bases=(Mixin, models.Model)).references_model('other_model')