コード例 #1
0
 def test_banned_main_user_remove_post_of_second_user(self):
     old_posts_count = PostPrototype._db_count()
     self.assertEqual(self.second_account, self.post4.author)
     self.request_login('*****@*****.**')
     self.check_ajax_error(
         self.client.post(url('forum:posts:delete', self.post4.id)),
         'common.ban_forum')
     self.assertEqual(old_posts_count, PostPrototype._db_count())
コード例 #2
0
ファイル: test_requests.py プロジェクト: pavetok/the-tale
    def test_delete_success(self):
        from the_tale.forum.prototypes import PostPrototype as ForumPostPrototype

        self.assertEqual(ForumPostPrototype._db_count(), 1)

        self.check_ajax_ok(self.client.post(reverse('blogs:posts:accept', args=[self.post.id]), {}))
        self.assertTrue(prototypes.PostPrototype.get_by_id(self.post.id).state.is_ACCEPTED)

        self.check_ajax_ok(self.client.post(reverse('blogs:posts:decline', args=[self.post.id]), {}))
        self.assertTrue(prototypes.PostPrototype.get_by_id(self.post.id).state.is_DECLINED)

        self.assertEqual(ForumPostPrototype._db_count(), 2)
コード例 #3
0
ファイル: test_requests.py プロジェクト: Tiendil/the-tale
    def test_delete_success(self):
        from the_tale.forum.prototypes import PostPrototype as ForumPostPrototype

        self.assertEqual(ForumPostPrototype._db_count(), 1)

        self.check_ajax_ok(self.client.post(reverse("blogs:posts:accept", args=[self.post.id]), {}))
        self.assertTrue(prototypes.PostPrototype.get_by_id(self.post.id).state.is_ACCEPTED)

        self.check_ajax_ok(self.client.post(reverse("blogs:posts:decline", args=[self.post.id]), {}))
        self.assertTrue(prototypes.PostPrototype.get_by_id(self.post.id).state.is_DECLINED)

        self.assertEqual(ForumPostPrototype._db_count(), 2)
コード例 #4
0
ファイル: test_moderation.py プロジェクト: Alkalit/the-tale
 def test_banned_main_user_remove_post_of_second_user(self):
     old_posts_count = PostPrototype._db_count()
     self.assertEqual(self.second_account, self.post4.author)
     self.request_login('*****@*****.**')
     self.check_ajax_error(self.client.post(url('forum:posts:delete', self.post4.id)), 'common.ban_forum')
     self.assertEqual(old_posts_count, PostPrototype._db_count())