diff options
author | Anssi Kääriäinen <akaariai@gmail.com> | 2014-11-18 11:24:33 +0200 |
---|---|---|
committer | Tim Graham <timograham@gmail.com> | 2014-11-26 17:49:25 -0500 |
commit | cbb5cdd155668ba771cad6b975676d3b20fed37b (patch) | |
tree | a4eeafd6853352561cc5e04b0d500197eb81a9fe /tests/dates | |
parent | cc870b8ef5e3464c6f051e3ef0a25dfc4b597452 (diff) | |
download | django-cbb5cdd155668ba771cad6b975676d3b20fed37b.tar.gz |
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.
Diffstat (limited to 'tests/dates')
-rw-r--r-- | tests/dates/tests.py | 7 |
1 files changed, 4 insertions, 3 deletions
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", |