'If document.allow_discussion is false, should return 404.'

def test_disallowed_404(self):

    u = UserFactory()
    self.client.login(username=u.username, password='testpass')
    doc = DocumentFactory(allow_discussion=False)
    def check(url):
        response = get(self.client, url, args=[doc.slug])
        st = response.status_code
        eq_(404, st, ('%s    was    %s,    not    404' % (url, st)))
    check('wiki.discuss.threads')
    check('wiki.discuss.new_thread')
    check('wiki.discuss.threads.feed')
