Commit 8579ca7c authored by 林颖's avatar 林颖

整合部分代码--修改错误函数名

parent 48f69191
......@@ -12,9 +12,9 @@ class topic_request(BaseRequest):
return self.api_send(self.data["vote"])
# 详情页内部-取消点赞
def topic_canclevote(self, topic_id):
def topic_cancelvote(self, topic_id):
self.params["topic_id"] = topic_id
return self.api_send(self.data["canclevote"])
return self.api_send(self.data["cancelvote"])
# 进入日记贴详情页-用来判断这篇日记贴点赞过没
def topic_detail(self, topic_id):
......
......@@ -9,7 +9,7 @@ vote:
isLogin: 1 #需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#取消点赞
canclevote:
cancelvote:
method: delete
url: /api/topic/vote/
params:
......
......@@ -26,6 +26,7 @@ DIARY_UPDATE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary_data
# 日记本进入相册页
DIARY_ALBUM_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "hybrid_diary_request.yaml")
DIARY_ALBUM = os.path.join(BASE_DIR, "backend_auto/test_backend_data/hybrid_data", "diary_album.yaml")
......
......@@ -17,7 +17,7 @@ class TestTopicReplyVote:
if r["error"] == 1:
assert r["message"] == param["assert3"]
# 回到取消点赞状态
canclevote = topicreply_vote_request().topic_reply_canclevote(param["id"])
canclevote = topicreply_vote_request().topic_reply_cancelvote(param["id"])
assert canclevote["error"] == 0
# 校验点赞
vote = topicreply_vote_request().topic_reply_vote(param["id"])
......@@ -27,7 +27,7 @@ class TestTopicReplyVote:
assert vote["message"] == param["assert3"]
assert vote["error"] == 1
# 最后取消点赞,回到取消点赞的状态
canclevote = topicreply_vote_request().topic_reply_canclevote(param["id"])
canclevote = topicreply_vote_request().topic_reply_cancelvote(param["id"])
assert canclevote["error"] == 0
elif r["error"] == 0:
# 说明已经点赞成功只需要校验重复点赞和取消点赞即可-二次点赞无效
......
......@@ -22,13 +22,13 @@ class TestVote:
assert vote["error"] == 0
assert vote["message"] == param["message1"]
# 取消点赞,回到取消点赞的状态
canclevote = topic_request().topic_cancelvote(param["topic_id"])
assert canclevote["error"] == 0
cancelvote = topic_request().topic_cancelvote(param["topic_id"])
assert cancelvote["error"] == 0
else:
# 如果是已经点过赞的状态就直接取消点赞
canclevote = topic_request().topic_cancelvote(param["topic_id"])
assert canclevote["error"] == 0
assert canclevote["message"] == param["message2"]
cancelvote = topic_request().topic_cancelvote(param["topic_id"])
assert cancelvote["error"] == 0
assert cancelvote["message"] == param["message2"]
......
......@@ -2,7 +2,7 @@ reply_create:
- assert1: null
case: 日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel: benzhan
content: ces测试+2021-06-18 15:31:03
content: ces测试+2021-06-18 16:41:48
message: 请勿回复重复内容
message1: 回复成功
message2: 你的回复有点频繁,稍后再来
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment