Skip to content

Commit d6e1b88

Browse files
committed
Testing chained pk lookups
1 parent 1d6770a commit d6e1b88

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/query/tests.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,13 @@ def test_multiple_filter_on_same_name(self):
234234
[]
235235
)
236236

237+
# Tests chaining on primary keys
238+
blog_id = Blog.objects.get().id
239+
self.assertEqual(
240+
Blog.objects.filter(pk = blog_id).filter(pk = blog_id).get(),
241+
Blog.objects.get()
242+
)
243+
237244
def test_negated_Q(self):
238245
blogs = [Blog.objects.create(title=title) for title in
239246
('blog', 'other blog', 'another blog')]

0 commit comments

Comments
 (0)