Пример #1
0
    def test_thread_replies(self):
        """create_post sets replies."""
        tiki_t = TikiThread.objects.filter(parentId=0)[0]
        f, t = helper_create_thread(tiki_t)

        tiki_p = TikiThread.objects.filter(parentId=tiki_t.threadId)[0]
        # create the post 3 times
        for i in range(3):
            create_post(t, tiki_p)
        # test the number of replies is 3
        eq_(3, t.replies)
Пример #2
0
    def test_post_basic(self):
        tiki_t = TikiThread.objects.get(pk=307195)
        f, t = helper_create_thread(tiki_t)

        tiki_p = TikiThread.objects.filter(parentId=tiki_t.threadId)[5]
        p = create_post(t, tiki_p)

        created_date = datetime.fromtimestamp(tiki_p.commentDate)

        eq_(t, p.thread)
        eq_(tiki_p.userName, p.author.username)
        eq_(tiki_p.userName, p.updated_by.username)
        eq_(created_date, p.created)
        eq_(created_date, p.updated)
        self.assertNotEquals('', p.content)