summaryrefslogtreecommitdiff
path: root/tests/get_earliest_or_latest
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2017-07-31 20:02:23 +0500
committerTim Graham <timograham@gmail.com>2017-07-31 11:02:23 -0400
commitaadd3aeb2ba3153e35bd805c80c901f289a6f333 (patch)
tree20d37a25e7ae620c12886dfe5aed981590dfd2dc /tests/get_earliest_or_latest
parent0f905e4b4479894f67b12ad976402a9660f0cae4 (diff)
downloaddjango-aadd3aeb2ba3153e35bd805c80c901f289a6f333.tar.gz
Avoided creating temporary lists for obtaining the first item.
Diffstat (limited to 'tests/get_earliest_or_latest')
-rw-r--r--tests/get_earliest_or_latest/tests.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/get_earliest_or_latest/tests.py b/tests/get_earliest_or_latest/tests.py
index c59f4324f0..eaa318663f 100644
--- a/tests/get_earliest_or_latest/tests.py
+++ b/tests/get_earliest_or_latest/tests.py
@@ -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):