'Check that an F() object referring to related column works correctly
in group by.'

def test_fobj_group_by(self):

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