mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Avoided creating temporary lists for obtaining the first item.
This commit is contained in:
committed by
Tim Graham
parent
0f905e4b44
commit
aadd3aeb2b
@@ -155,7 +155,7 @@ class TestFirstLast(TestCase):
|
||||
# We know that we've broken the __iter__ method, so the queryset
|
||||
# should always raise an exception.
|
||||
with self.assertRaises(IndexError):
|
||||
IndexErrorArticle.objects.all()[0]
|
||||
IndexErrorArticle.objects.all()[:10:2]
|
||||
with self.assertRaises(IndexError):
|
||||
IndexErrorArticle.objects.all().first()
|
||||
with self.assertRaises(IndexError):
|
||||
|
||||
Reference in New Issue
Block a user