'Check that lookups can be resolved for related fields
in the reverse direction.'

@unittest.skipIf((django.VERSION < (1, 9)), 'version    does    not    reverse    lookups')
def test_resolve_reverse_related_lookups(self):

    lookups = ['exact', 'gte', 'gt', 'lte', 'lt', 'in', 'isnull']
    model_field = User._meta.get_field('article')
    for term in lookups:
        (field, lookup) = resolve_field(model_field, term)
        self.assertIsInstance(field, models.ManyToOneRel)
        self.assertEqual(lookup, term)
    model_field = Book._meta.get_field('lovers')
    for term in lookups:
        (field, lookup) = resolve_field(model_field, term)
        self.assertIsInstance(field, models.ManyToManyRel)
        self.assertEqual(lookup, term)
