Updated null_queries tests to avoid clashing with the __second lookup.
This commit is contained in:
parent
c01bbb3235
commit
104d82a777
|
@ -28,4 +28,5 @@ class OuterB(models.Model):
|
|||
|
||||
class Inner(models.Model):
|
||||
first = models.ForeignKey(OuterA)
|
||||
second = models.ForeignKey(OuterB, null=True)
|
||||
# second would clash with the __second lookup.
|
||||
third = models.ForeignKey(OuterB, null=True)
|
||||
|
|
|
@ -55,17 +55,17 @@ class NullQueriesTests(TestCase):
|
|||
"""
|
||||
obj = OuterA.objects.create()
|
||||
self.assertQuerysetEqual(
|
||||
OuterA.objects.filter(inner__second=None),
|
||||
OuterA.objects.filter(inner__third=None),
|
||||
['<OuterA: OuterA object>']
|
||||
)
|
||||
self.assertQuerysetEqual(
|
||||
OuterA.objects.filter(inner__second__data=None),
|
||||
OuterA.objects.filter(inner__third__data=None),
|
||||
['<OuterA: OuterA object>']
|
||||
)
|
||||
|
||||
inner_obj = Inner.objects.create(first=obj)
|
||||
self.assertQuerysetEqual(
|
||||
Inner.objects.filter(first__inner__second=None),
|
||||
Inner.objects.filter(first__inner__third=None),
|
||||
['<Inner: Inner object>']
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue