              event = models.ForeignKey(Event)
              invitee = models.ForeignKey(Fan)
              inviter = models.ForeignKey(Fan, related_name='+')
  
          with self.assertRaisesMessage(FieldDoesNotExist, 'invalid_field'):
              Event().invitees.all()
  
      def test_explicit_field_names(self):
          """
          Tests that if ``through_fields`` kwarg is given, it must specify both
          link fields of the intermediary table.
 
</s> remove         with self.assertRaisesMessage(FieldDoesNotExist, 'invalid_field'):
            Event().invitees.all()
 </s> add         field = Event._meta.get_field('invitees')
        errors = field.check(from_model=Event)
        expected = [
            Error(
                ("'Invitation.invitee' is not a foreign key to 'Event'."),
                hint="Did you mean one of the following foreign keys to 'Event': event?",
                obj=field,
                id='fields.E339'),
            Error(
                ("'Invitation.event' is not a foreign key to 'Fan'."),
                hint="Did you mean one of the following foreign keys to 'Fan': invitee, inviter?",
                obj=field,
                id='fields.E339'),
        ]
        self.assertEqual(expected, errors) </s> remove             invitees = models.ManyToManyField(Fan, through='Invitation', through_fields=('event', 'invalid_field'))
 </s> add             invitees = models.ManyToManyField(Fan, through='Invitation', through_fields=('invalid_field_1', 'invalid_field_2')) </s> remove             invitees = models.ManyToManyField(Fan, through='Invitation', through_fields=('invalid_field', 'invitee'))
 </s> add             invitees = models.ManyToManyField(Fan, through='Invitation', through_fields=('invitee', 'event')) </s> remove * **fields.E337**: The field is given an iterable for through_fields, which does not provide the names for both link fields that Django should use for the relation through <model>.
 </s> add * **fields.E337**: Field specifies ``through_fields`` but does not provide the names of the two link fields that should be used for the relation through ``<model>``.
* **fields.E338**: The intermediary model ``<through model>`` has no field ``<field name>``.
* **fields.E339**: ``<model>.<field name>`` is not a foreign key to ``<model>``. </s> remove     def test_invalid_m2m_reverse_field(self):
 </s> add     def test_invalid_field(self):
        field = Event._meta.get_field('invitees')
        errors = field.check(from_model=Event)
        expected = [
            Error(
                ("The intermediary model 'invalid_models_tests.Invitation' has no field 'invalid_field_1'."),
                hint="Did you mean one of the following foreign keys to 'Event': event?",
                obj=field,
                id='fields.E338'),
            Error(
                ("The intermediary model 'invalid_models_tests.Invitation' has no field 'invalid_field_2'."),
                hint="Did you mean one of the following foreign keys to 'Fan': invitee, inviter?",
                obj=field,
                id='fields.E338'),
        ]
        self.assertEqual(expected, errors)
              event = models.ForeignKey(Event)
              invitee = models.ForeignKey(Fan)
              inviter = models.ForeignKey(Fan, related_name='+')
  
        field = Event._meta.get_field('invitees')
        errors = field.check(from_model=Event)
        expected = [
            Error(
                ("The intermediary model 'invalid_models_tests.Invitation' has no field 'invalid_field_1'."),
                hint="Did you mean one of the following foreign keys to 'Event': event?",
                obj=field,
                id='fields.E338'),
            Error(
                ("The intermediary model 'invalid_models_tests.Invitation' has no field 'invalid_field_2'."),
                hint="Did you mean one of the following foreign keys to 'Fan': invitee, inviter?",
                obj=field,
                id='fields.E338'),
        ]
        self.assertEqual(expected, errors)
        field = Event._meta.get_field('invitees')
        errors = field.check(from_model=Event)
        expected = [
            Error(
                ("The intermediary model 'invalid_models_tests.Invitation' has no field 'invalid_field_1'."),
                hint="Did you mean one of the following foreign keys to 'Event': event?",
                obj=field,
                id='fields.E338'),
            Error(
                ("The intermediary model 'invalid_models_tests.Invitation' has no field 'invalid_field_2'."),
                hint="Did you mean one of the following foreign keys to 'Fan': invitee, inviter?",
                obj=field,
                id='fields.E338'),
        ]
        self.assertEqual(expected, errors)
  
      def test_explicit_field_names(self):
          """
          Tests that if ``through_fields`` kwarg is given, it must specify both
          link fields of the intermediary table.
keep keep keep keep replace replace keep keep keep keep keep
 Fixed #22217 - ManyToManyField.through_fields fixes.

- Docs description of arguments mix up.
- Keep it from erroneously masking E332 check.
- Add checks E338 and E339, tweak message of E337. 
tests/invalid_models_tests/test_relative_fields.py