mirror of
https://github.com/django/django.git
synced 2025-11-02 12:58:56 +00:00
Avoided creating temporary lists for obtaining the first item.
This commit is contained in:
parent
0f905e4b44
commit
aadd3aeb2b
8 changed files with 17 additions and 19 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue