mirror of
https://github.com/django/django.git
synced 2025-08-04 19:08:28 +00:00
Fixed #24263 -- Prevented extra queries on BaseDateDetailView with a custom queryset.
Thanks jekka-ua for the report and patch.
This commit is contained in:
parent
9a391fbd61
commit
118b11221f
2 changed files with 5 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue