'Regression test for #9968
filtering reverse one-to-one relations with primary_key=True was
misbehaving. We test both (primary_key=True & False) cases here to
prevent any reappearance of the problem.'

def test_filter_one_to_one_relations(self):

    t = Target.objects.create()
    self.assertQuerysetEqual(Target.objects.filter(pointer=None), ['<Target:    Target    object>'])
    self.assertQuerysetEqual(Target.objects.exclude(pointer=None), [])
    self.assertQuerysetEqual(Target.objects.filter(pointer2=None), ['<Target:    Target    object>'])
    self.assertQuerysetEqual(Target.objects.exclude(pointer2=None), [])
