diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/migrations/test_autodetector.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/migrations/test_autodetector.py b/tests/migrations/test_autodetector.py index 67cc39dec7..fb42a8a455 100644 --- a/tests/migrations/test_autodetector.py +++ b/tests/migrations/test_autodetector.py @@ -1779,6 +1779,29 @@ class AutodetectorTests(TestCase): self.assertOperationAttributes(changes, "testapp", 0, 0, name="AuthorProxy") self.assertOperationAttributes(changes, "testapp", 0, 1, name="AuthorProxy", options={}) + def test_proxy_non_model_parent(self): + class Mixin: + pass + + author_proxy_non_model_parent = ModelState( + 'testapp', + 'AuthorProxy', + [], + {'proxy': True}, + (Mixin, 'testapp.author'), + ) + changes = self.get_changes( + [self.author_empty], + [self.author_empty, author_proxy_non_model_parent], + ) + self.assertNumberMigrations(changes, 'testapp', 1) + self.assertOperationTypes(changes, 'testapp', 0, ['CreateModel']) + self.assertOperationAttributes( + changes, 'testapp', 0, 0, name='AuthorProxy', + options={'proxy': True, 'indexes': [], 'constraints': []}, + bases=(Mixin, 'testapp.author'), + ) + def test_proxy_custom_pk(self): """ #23415 - The autodetector must correctly deal with custom FK on proxy |
