Exemplo n.º 1
0
    def test_it(self):
        journal = self.addJournal()
        post = self.addPost()
        comment = self.addComment()

        request = testing.DummyRequest()
        view = CommentView(comment, request)
        info = view.view()

        self.assertEqual(info.body, b'First Comment')
Exemplo n.º 2
0
    def test_it(self):
        journal = self.addJournal()
        post = self.addPost()
        comment = self.addComment()

        request = testing.DummyRequest()
        view = CommentView(comment, request)
        info = view.view()

        self.assertEqual(info.body, b'First Comment')
Exemplo n.º 3
0
    def test_hide(self):
        journal = self.addJournal()
        post = self.addPost()
        comment = self.addComment()
        comment.hidden = False

        request = testing.DummyRequest()
        view = CommentView(comment, request)
        info = view.reject()

        self.assertTrue(comment.hidden)
Exemplo n.º 4
0
    def test_publish(self):
        journal = self.addJournal()
        post = self.addPost()
        comment = self.addComment()
        comment.hidden = True

        request = testing.DummyRequest()
        view = CommentView(comment, request)
        info = view.publish()

        self.assertFalse(comment.hidden)
Exemplo n.º 5
0
    def test_hide(self):
        journal = self.addJournal()
        post = self.addPost()
        comment = self.addComment()
        comment.hidden = False

        request = testing.DummyRequest()
        view = CommentView(comment, request)
        info = view.reject()

        self.assertTrue(comment.hidden)
Exemplo n.º 6
0
    def test_publish(self):
        journal = self.addJournal()
        post = self.addPost()
        comment = self.addComment()
        comment.hidden = True

        request = testing.DummyRequest()
        view = CommentView(comment, request)
        info = view.publish()

        self.assertFalse(comment.hidden)