'Check that groups_for_user returns correct values as per
http://code.google.com/p/modwsgi/wiki/AccessControlMechanisms#Apache_Group_Authorisation'

@skipIfCustomUser
def test_groups_for_user(self):

    user1 = User.objects.create_user(u'test', u'test@example.com', u'test')
    User.objects.create_user(u'test1', u'test1@example.com', u'test1')
    group = Group.objects.create(name=u'test_group')
    user1.groups.add(group)
    self.assertEqual(groups_for_user({}, u'unknown'), [])
    self.assertEqual(groups_for_user({}, u'test'), ['test_group'])
    self.assertEqual(groups_for_user({}, u'test1'), [])
