diff options
| author | Simon Charette <charettes@users.noreply.github.com> | 2016-04-28 18:20:48 -0400 |
|---|---|---|
| committer | Simon Charette <charettes@users.noreply.github.com> | 2016-04-28 18:20:48 -0400 |
| commit | f951bb78cbf179f0fb70fe74ae0c218925fd7ede (patch) | |
| tree | 9d7432353e29271cbea3882625ec9b104a2f1045 /tests | |
| parent | ce32c3e2cc8bdaa9557d4f3c9d830d7af3d01ca9 (diff) | |
Refs #26521 -- Adjusted CreateModel bases validation to account for mixins.
Thanks Collin for the report.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/migrations/test_operations.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/migrations/test_operations.py b/tests/migrations/test_operations.py index d34a6a4284..f86a39f5ee 100644 --- a/tests/migrations/test_operations.py +++ b/tests/migrations/test_operations.py @@ -19,6 +19,10 @@ except ImportError: sqlparse = None +class Mixin(object): + pass + + class OperationTestBase(MigrationTestBase): """ Common functions to help test operations. @@ -244,6 +248,20 @@ class OperationTests(OperationTestBase): fields=[], bases=(UnicodeModel, 'migrations.UnicodeModel',), ) + message = "Found duplicate value <class 'django.db.models.base.Model'> in CreateModel bases argument." + with self.assertRaisesMessage(ValueError, message): + migrations.CreateModel( + "Pony", + fields=[], + bases=(models.Model, models.Model,), + ) + message = "Found duplicate value <class 'migrations.test_operations.Mixin'> in CreateModel bases argument." + with self.assertRaisesMessage(ValueError, message): + migrations.CreateModel( + "Pony", + fields=[], + bases=(Mixin, Mixin,), + ) def test_create_model_with_duplicate_manager_name(self): with self.assertRaisesMessage(ValueError, 'Found duplicate value objects in CreateModel managers argument.'): |
