mirror of
https://github.com/django/django.git
synced 2025-08-02 18:13:02 +00:00
Fixed #13815 -- Ensure that reverse exclude lookups on nullable foreign keys exclude null values. Thanks to bpeschier for the report and patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15458 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
340eaded4e
commit
d3b38d578f
2 changed files with 19 additions and 0 deletions
|
@ -67,3 +67,15 @@ class NullQueriesTests(TestCase):
|
|||
['<Inner: Inner object>']
|
||||
)
|
||||
|
||||
# Ticket #13815: check if <reverse>_isnull=False does not produce
|
||||
# faulty empty lists
|
||||
objB = OuterB.objects.create(data="reverse")
|
||||
self.assertQuerysetEqual(
|
||||
OuterB.objects.filter(inner__isnull=False),
|
||||
[]
|
||||
)
|
||||
Inner.objects.create(first=obj)
|
||||
self.assertQuerysetEqual(
|
||||
OuterB.objects.exclude(inner__isnull=False),
|
||||
['<OuterB: OuterB object>']
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue