Exemplo n.º 1
0
    def test_dao_delete_comment(self):
        self.create_task_comment()

        TaskCommentDAO.delete_comment(user_id=1,
                                      _id=1,
                                      task_id=1,
                                      relation_id=2)

        expected_response = messages.TASK_COMMENT_DOES_NOT_EXIST, 404
        actual_response = TaskCommentDAO.get_task_comment(1, 1)

        # Verify that task comment was deleted
        self.assertEqual(expected_response, actual_response)
    def delete(cls, relation_id, task_id, comment_id):
        """
        Deletes the task comment.
        """

        return TaskCommentDAO.delete_comment(get_jwt_identity(), comment_id,
                                             task_id, relation_id)