From cbb5cdd155668ba771cad6b975676d3b20fed37b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anssi=20K=C3=A4=C3=A4ri=C3=A4inen?= Date: Tue, 18 Nov 2014 11:24:33 +0200 Subject: 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. --- tests/dates/tests.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/dates') diff --git a/tests/dates/tests.py b/tests/dates/tests.py index 2177ad046e..cc6a571d0d 100644 --- a/tests/dates/tests.py +++ b/tests/dates/tests.py @@ -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", -- cgit v1.2.1