'Verify that the function works when the objects that should be returned
have non-integer primary keys, and those objects are due to the user\'s
groups.'

def test_non_integer_primary_key_with_group_values(self):

    obj_with_char_pk = NonIntPKModel.objects.create(char_pk=u'testprimarykey')
    assign_perm(u'add_nonintpkmodel', self.group, obj_with_char_pk)
    self.user.groups.add(self.group)
    objects = get_objects_for_user(self.user, [u'testapp.add_nonintpkmodel', u'testapp.change_nonintpkmodel'], any_perm=True)
    self.assertEqual(len(objects), 1)
    self.assertTrue(isinstance(objects, QuerySet))
    self.assertEqual(set(objects.values_list(u'pk', flat=True)), set([obj_with_char_pk.pk]))
