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())
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)
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)
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())