summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/model_inheritance/tests.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/model_inheritance/tests.py b/tests/model_inheritance/tests.py
index 0ba6a15e5d..a2013a6b68 100644
--- a/tests/model_inheritance/tests.py
+++ b/tests/model_inheritance/tests.py
@@ -323,3 +323,27 @@ class ModelInheritanceTests(TestCase):
# Equality doesn't transfer in multitable inheritance.
self.assertNotEqual(Place(id=1), Restaurant(id=1))
self.assertNotEqual(Restaurant(id=1), Place(id=1))
+
+ def test_ticket_12567(self):
+ r = Restaurant.objects.create(name='n1', address='a1')
+ s = Supplier.objects.create(name='s1', address='a2')
+ self.assertQuerysetEqual(
+ Place.objects.filter(supplier__isnull=False),
+ [Place.objects.get(pk=s.pk)],
+ lambda x: x
+ )
+ self.assertQuerysetEqual(
+ Place.objects.filter(supplier__isnull=True),
+ [Place.objects.get(pk=r.pk)],
+ lambda x: x
+ )
+ self.assertQuerysetEqual(
+ Place.objects.exclude(supplier__isnull=False),
+ [Place.objects.get(pk=r.pk)],
+ lambda x: x
+ )
+ self.assertQuerysetEqual(
+ Place.objects.exclude(supplier__isnull=True),
+ [Place.objects.get(pk=s.pk)],
+ lambda x: x
+ )