summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2011-02-08 14:06:02 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2011-02-08 14:06:02 +0000
commitd3b38d578f41240442cb043012b0035a20eebd67 (patch)
treeb154f9c9c19135f3bf10fc9ba1e091de35f55d9d /tests
parent340eaded4e30cf25bcd4e9781d33a617fe9c0f84 (diff)
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
Diffstat (limited to 'tests')
-rw-r--r--tests/regressiontests/null_queries/tests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/regressiontests/null_queries/tests.py b/tests/regressiontests/null_queries/tests.py
index 72dcd5153c..8392c588e4 100644
--- a/tests/regressiontests/null_queries/tests.py
+++ b/tests/regressiontests/null_queries/tests.py
@@ -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>']
+ )