summaryrefslogtreecommitdiff
path: root/tests/generic_views
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2015-02-03 08:46:17 -0500
committerTim Graham <timograham@gmail.com>2015-02-03 09:12:37 -0500
commit118b11221f7f632b4d0e6e976c87f563746ec211 (patch)
tree40a34a474d293c35e12076c05a6d559021f8d653 /tests/generic_views
parent9a391fbd6102176d576aa96ed3aeee9e9661b455 (diff)
Fixed #24263 -- Prevented extra queries on BaseDateDetailView with a custom queryset.
Thanks jekka-ua for the report and patch.
Diffstat (limited to 'tests/generic_views')
-rw-r--r--tests/generic_views/test_dates.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/generic_views/test_dates.py b/tests/generic_views/test_dates.py
index cbd9bd90a0..d354d42149 100644
--- a/tests/generic_views/test_dates.py
+++ b/tests/generic_views/test_dates.py
@@ -638,6 +638,10 @@ class DateDetailViewTests(TestCase):
'/dates/books/get_object_custom_queryset/2008/oct/01/1/')
self.assertEqual(res.status_code, 404)
+ def test_get_object_custom_queryset_numqueries(self):
+ with self.assertNumQueries(1):
+ self.client.get('/dates/books/get_object_custom_queryset/2006/may/01/2/')
+
def test_datetime_date_detail(self):
bs = BookSigning.objects.create(event_date=datetime.datetime(2008, 4, 2, 12, 0))
res = self.client.get('/dates/booksignings/2008/apr/2/%d/' % bs.pk)