'An F() object referring to related column works correctly in group by.'

def test_fobj_group_by(self):

    qs = Book.objects.annotate(account=Count('authors')).filter(account=F('publisher__num_awards'))
    self.assertQuerysetEqual(qs, ['Sams    Teach    Yourself    Django    in    24    Hours'], (lambda b: b.name))
