summaryrefslogtreecommitdiff
path: root/tests/custom_columns
diff options
context:
space:
mode:
authorMads Jensen <mje@inducks.org>2017-05-28 21:37:21 +0200
committerTim Graham <timograham@gmail.com>2017-07-29 19:07:23 -0400
commita51c4de1945be2225f20fad794cfb52d8f1f9236 (patch)
tree36386b70a27cf027a8a491de319c3e59e0d3d0cd /tests/custom_columns
parent38988f289f7f5708f5ea85de2d5dfe0d86b23106 (diff)
downloaddjango-a51c4de1945be2225f20fad794cfb52d8f1f9236.tar.gz
Used assertRaisesMessage() to test Django's error messages.
Diffstat (limited to 'tests/custom_columns')
-rw-r--r--tests/custom_columns/tests.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/custom_columns/tests.py b/tests/custom_columns/tests.py
index 2d7044b8de..f5dfd9c0cd 100644
--- a/tests/custom_columns/tests.py
+++ b/tests/custom_columns/tests.py
@@ -37,7 +37,11 @@ class CustomColumnsTests(TestCase):
)
def test_field_error(self):
- with self.assertRaises(FieldError):
+ msg = (
+ "Cannot resolve keyword 'firstname' into field. Choices are: "
+ "Author_ID, article, first_name, last_name, primary_set"
+ )
+ with self.assertRaisesMessage(FieldError, msg):
Author.objects.filter(firstname__exact="John")
def test_attribute_error(self):