'Using through_fields in a m2m with an intermediate model shouldn\'t
mask its incompatibility with symmetry.'

def test_symmetric_self_reference_with_intermediate_table_and_through_fields(self):

    class Person(models.Model, ):
        friends = models.ManyToManyField('self', symmetrical=True, through='Relationship', through_fields=('first', 'second'))
    class Relationship(models.Model, ):
        first = models.ForeignKey(Person, models.CASCADE, related_name='rel_from_set')
        second = models.ForeignKey(Person, models.CASCADE, related_name='rel_to_set')
        referee = models.ForeignKey(Person, models.CASCADE, related_name='referred')
    field = Person._meta.get_field('friends')
    self.assertEqual(field.check(from_model=Person), [Error('Many-to-many    fields    with    intermediate    tables    must    not    be    symmetrical.', obj=field, id='fields.E332')])
