summaryrefslogtreecommitdiff
path: root/tests/foreign_object
diff options
context:
space:
mode:
Diffstat (limited to 'tests/foreign_object')
-rw-r--r--tests/foreign_object/tests.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/foreign_object/tests.py b/tests/foreign_object/tests.py
index e74732ab72..59d4357802 100644
--- a/tests/foreign_object/tests.py
+++ b/tests/foreign_object/tests.py
@@ -368,7 +368,12 @@ class MultiColumnFKTests(TestCase):
ArticleTag.objects.create(article=a1, name="foo")
self.assertEqual(Article.objects.filter(tag__name="foo").count(), 1)
self.assertEqual(Article.objects.filter(tag__name="bar").count(), 0)
- with self.assertRaises(FieldError):
+ msg = (
+ "Cannot resolve keyword 'tags' into field. Choices are: "
+ "active_translation, active_translation_q, articletranslation, "
+ "id, idea_things, newsarticle, pub_date, tag"
+ )
+ with self.assertRaisesMessage(FieldError, msg):
Article.objects.filter(tags__name="foo")
def test_many_to_many_related_query_name(self):
@@ -377,7 +382,12 @@ class MultiColumnFKTests(TestCase):
a1.ideas.add(i1)
self.assertEqual(Article.objects.filter(idea_things__name="idea1").count(), 1)
self.assertEqual(Article.objects.filter(idea_things__name="idea2").count(), 0)
- with self.assertRaises(FieldError):
+ msg = (
+ "Cannot resolve keyword 'ideas' into field. Choices are: "
+ "active_translation, active_translation_q, articletranslation, "
+ "id, idea_things, newsarticle, pub_date, tag"
+ )
+ with self.assertRaisesMessage(FieldError, msg):
Article.objects.filter(ideas__name="idea1")
@translation.override('fi')