Skip to content
Browse files

Updated null_queries tests to avoid clashing with the __second lookup.

  • Loading branch information...
1 parent c01bbb3 commit 104d82a7778cf3f0f5d03dfa53709c26df45daad @aaugustin aaugustin committed
Showing with 5 additions and 4 deletions.
  1. +2 −1 tests/regressiontests/null_queries/models.py
  2. +3 −3 tests/regressiontests/null_queries/tests.py
View
3 tests/regressiontests/null_queries/models.py
@@ -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)
View
6 tests/regressiontests/null_queries/tests.py
@@ -55,17 +55,17 @@ def test_reverse_relations(self):
"""
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>']
)

0 comments on commit 104d82a

Please sign in to comment.
Something went wrong with that request. Please try again.