          i1 = ArticleIdea.objects.create(name="idea1")
          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):
              Article.objects.filter(ideas__name="idea1")
  
      @translation.override('fi')
      def test_inheritance(self):
          na = NewsArticle.objects.create(pub_date=datetime.date.today())
 
</s> remove         with self.assertRaises(FieldError):
 </s> add         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): </s> remove         with self.assertRaises(TypeError):
 </s> add         msg = 'Cannot call delete() after .values() or .values_list()'
        with self.assertRaisesMessage(TypeError, msg): </s> remove         with self.assertRaises(FieldError):
 </s> add         msg = "Unsupported lookup 'blahblah' for CharField or join on the field not permitted."
        with self.assertRaisesMessage(FieldError, msg): </s> remove             with self.assertRaises(FieldError):
 </s> add             msg = "Joined field references are not permitted in this query"
            with self.assertRaisesMessage(FieldError, msg): </s> remove         with self.assertRaises(FieldError):
 </s> add         msg = (
            "Cannot resolve keyword 'firstname' into field. Choices are: "
            "Author_ID, article, first_name, last_name, primary_set"
        )
        with self.assertRaisesMessage(FieldError, msg):
        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):
          i1 = ArticleIdea.objects.create(name="idea1")
          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)
        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')
      def test_inheritance(self):
          na = NewsArticle.objects.create(pub_date=datetime.date.today())
keep keep keep keep replace keep keep keep keep keep
 Used assertRaisesMessage() to test Django's error messages. 
tests/foreign_object/tests.py