'Lock action - thread belongs to forum.'

def test_locked_thread_belongs_to_forum(self):

    f = ForumFactory()
    t = ThreadFactory()
    u = UserFactory()
    g = GroupFactory()
    ct = ContentType.objects.get_for_model(f)
    PermissionFactory(codename='forums_forum.thread_locked_forum', content_type=ct, object_id=f.id, group=g)
    PermissionFactory(codename='forums_forum.thread_locked_forum', content_type=ct, object_id=t.forum.id, group=g)
    g.user_set.add(u)
    self.client.login(username=u.username, password='testpass')
    r = post(self.client, 'forums.lock_thread', {}, args=[f.slug, t.id])
    eq_(404, r.status_code)
