'Assert has_perm checks per-object permissions correctly.'

def test_has_perm_per_object(self):

    from kitsune.forums.tests import RestrictedForumFactory
    f1 = RestrictedForumFactory()
    f2 = RestrictedForumFactory()
    u = UserFactory()
    perm = 'forums_forum.view_in_forum'
    ct = ContentType.objects.get_for_model(f1)
    PermissionFactory(codename=perm, content_type=ct, object_id=f1.id, user=u)
    assert access.has_perm(u, perm, f1)
    assert (not access.has_perm(u, perm, f2))
