diff --git a/django/views/generic/dates.py b/django/views/generic/dates.py
index b80b7ff..4b48439 100644
a
|
b
|
class BaseDateDetailView(YearMixin, MonthMixin, DayMixin, DateMixin, BaseDetailV
|
644 | 644 | day, self.get_day_format()) |
645 | 645 | |
646 | 646 | # Use a custom queryset if provided |
647 | | qs = queryset or self.get_queryset() |
| 647 | qs = self.get_queryset() if queryset is None else queryset |
648 | 648 | |
649 | 649 | if not self.get_allow_future() and date > datetime.date.today(): |
650 | 650 | raise Http404(_("Future %(verbose_name_plural)s not available because %(class_name)s.allow_future is False.") % { |
diff --git a/tests/generic_views/test_dates.py b/tests/generic_views/test_dates.py
index 07cb13a..a090876 100644
a
|
b
|
class DateDetailViewTests(TestCase):
|
602 | 602 | '/dates/books/get_object_custom_queryset/2008/oct/01/1/') |
603 | 603 | self.assertEqual(res.status_code, 404) |
604 | 604 | |
| 605 | def test_get_object_custom_queryset_numqueries(self): |
| 606 | # Regression test for #24263 |
| 607 | with self.assertNumQueries(1): |
| 608 | self.client.get( |
| 609 | '/dates/books/get_object_custom_queryset/2006/may/01/2/') |
| 610 | |
605 | 611 | def test_datetime_date_detail(self): |
606 | 612 | bs = BookSigning.objects.create(event_date=datetime.datetime(2008, 4, 2, 12, 0)) |
607 | 613 | res = self.client.get('/dates/booksignings/2008/apr/2/%d/' % bs.pk) |