mirror of
https://github.com/django/django.git
synced 2025-10-09 18:12:39 +00:00
Made FieldError/FieldDoesNotExist messages uniform across Python versions.
Removed possible u'' prefixes on Python 2.
This commit is contained in:
parent
9027e6c8a3
commit
631ef6b272
5 changed files with 9 additions and 11 deletions
|
@ -6,7 +6,6 @@ from unittest import skipUnless
|
|||
from django.core.exceptions import FieldError
|
||||
from django.db import connection
|
||||
from django.test import TestCase, override_settings
|
||||
from django.utils import six
|
||||
|
||||
from .models import Article, Category, Comment
|
||||
|
||||
|
@ -86,10 +85,9 @@ class DatesTests(TestCase):
|
|||
Article.objects.dates()
|
||||
|
||||
def test_dates_fails_when_given_invalid_field_argument(self):
|
||||
six.assertRaisesRegex(
|
||||
self,
|
||||
self.assertRaisesMessage(
|
||||
FieldError,
|
||||
"Cannot resolve keyword u?'invalid_field' into field. Choices are: "
|
||||
"Cannot resolve keyword 'invalid_field' into field. Choices are: "
|
||||
"categories, comments, id, pub_date, pub_datetime, title",
|
||||
Article.objects.dates,
|
||||
"invalid_field",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue