From aadd3aeb2ba3153e35bd805c80c901f289a6f333 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Mon, 31 Jul 2017 20:02:23 +0500 Subject: Avoided creating temporary lists for obtaining the first item. --- tests/get_earliest_or_latest/tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/get_earliest_or_latest') 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): -- cgit v1.2.1