mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #23867 -- removed DateQuerySet hacks
The .dates() queries were implemented by using custom Query, QuerySet, and Compiler classes. Instead implement them by using expressions and database converters APIs.
This commit is contained in:
committed by
Tim Graham
parent
cc870b8ef5
commit
cbb5cdd155
@@ -2,7 +2,7 @@ from __future__ import unicode_literals
|
||||
|
||||
import datetime
|
||||
|
||||
from django.db.models.fields import FieldDoesNotExist
|
||||
from django.core.exceptions import FieldError
|
||||
from django.test import TestCase
|
||||
from django.utils import six
|
||||
|
||||
@@ -93,8 +93,9 @@ class DatesTests(TestCase):
|
||||
def test_dates_fails_when_given_invalid_field_argument(self):
|
||||
six.assertRaisesRegex(
|
||||
self,
|
||||
FieldDoesNotExist,
|
||||
"Article has no field named 'invalid_field'",
|
||||
FieldError,
|
||||
"Cannot resolve keyword u?'invalid_field' into field. Choices are: "
|
||||
"categories, comments, id, pub_date, title",
|
||||
Article.objects.dates,
|
||||
"invalid_field",
|
||||
"year",
|
||||
|
||||
Reference in New Issue
Block a user