diff options
| author | Tim Graham <timograham@gmail.com> | 2016-12-28 11:44:26 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2016-12-28 12:48:17 -0500 |
| commit | e3e80da7a59f6fcef814b951f5a77a33584e3b62 (patch) | |
| tree | ebb37d8cf13594d502406d68cd2967c754f0b233 /tests | |
| parent | aaecf038cae61f114db396f74e06759c95f21e93 (diff) | |
Fixed #27651 -- Allowed M2M to concrete and proxy through model.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/invalid_models_tests/test_models.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/invalid_models_tests/test_models.py b/tests/invalid_models_tests/test_models.py index b50b265bd4..78f2164ed5 100644 --- a/tests/invalid_models_tests/test_models.py +++ b/tests/invalid_models_tests/test_models.py @@ -899,6 +899,24 @@ class OtherModelTests(SimpleTestCase): self.assertEqual(C1.check(), []) self.assertEqual(C2.check(), []) + def test_m2m_to_concrete_and_proxy_allowed(self): + class A(models.Model): + pass + + class Through(models.Model): + a = models.ForeignKey('A', models.CASCADE) + c = models.ForeignKey('C', models.CASCADE) + + class ThroughProxy(Through): + class Meta: + proxy = True + + class C(models.Model): + mm_a = models.ManyToManyField(A, through=Through) + mm_aproxy = models.ManyToManyField(A, through=ThroughProxy, related_name='proxied_m2m') + + self.assertEqual(C.check(), []) + @isolate_apps('django.contrib.auth', kwarg_name='apps') def test_lazy_reference_checks(self, apps): class DummyModel(models.Model): |
