Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
backend_auto
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
邓莹莹
backend_auto
Commits
8579ca7c
Commit
8579ca7c
authored
Jun 18, 2021
by
林颖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整合部分代码--修改错误函数名
parent
48f69191
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
12 additions
and
11 deletions
+12
-11
topic_request.py
all_backend_api/topic_request.py
+2
-2
topic_request.yaml
all_backend_api/topic_request.yaml
+1
-1
path_setting.py
path_setting.py
+1
-0
test_topic_reply_vote.py
test_backend_case/topic_case/test_topic_reply_vote.py
+2
-2
test_vote.py
test_backend_case/topic_case/test_vote.py
+5
-5
topic_reply_create.yaml
test_backend_data/topic_data/topic_reply_create.yaml
+1
-1
No files found.
all_backend_api/topic_request.py
View file @
8579ca7c
...
...
@@ -12,9 +12,9 @@ class topic_request(BaseRequest):
return
self
.
api_send
(
self
.
data
[
"vote"
])
# 详情页内部-取消点赞
def
topic_canc
le
vote
(
self
,
topic_id
):
def
topic_canc
el
vote
(
self
,
topic_id
):
self
.
params
[
"topic_id"
]
=
topic_id
return
self
.
api_send
(
self
.
data
[
"canc
le
vote"
])
return
self
.
api_send
(
self
.
data
[
"canc
el
vote"
])
# 进入日记贴详情页-用来判断这篇日记贴点赞过没
def
topic_detail
(
self
,
topic_id
):
...
...
all_backend_api/topic_request.yaml
View file @
8579ca7c
...
...
@@ -9,7 +9,7 @@ vote:
isLogin
:
1
#需要登录添加这个字段,值为1 0是不需要登录的情况,如不需要登录,可以不添加这个字段
#取消点赞
canc
le
vote
:
canc
el
vote
:
method
:
delete
url
:
/api/topic/vote/
params
:
...
...
path_setting.py
View file @
8579ca7c
...
...
@@ -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"
)
...
...
test_backend_case/topic_case/test_topic_reply_vote.py
View file @
8579ca7c
...
...
@@ -17,7 +17,7 @@ class TestTopicReplyVote:
if
r
[
"error"
]
==
1
:
assert
r
[
"message"
]
==
param
[
"assert3"
]
# 回到取消点赞状态
canclevote
=
topicreply_vote_request
()
.
topic_reply_canc
le
vote
(
param
[
"id"
])
canclevote
=
topicreply_vote_request
()
.
topic_reply_canc
el
vote
(
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_canc
le
vote
(
param
[
"id"
])
canclevote
=
topicreply_vote_request
()
.
topic_reply_canc
el
vote
(
param
[
"id"
])
assert
canclevote
[
"error"
]
==
0
elif
r
[
"error"
]
==
0
:
# 说明已经点赞成功只需要校验重复点赞和取消点赞即可-二次点赞无效
...
...
test_backend_case/topic_case/test_vote.py
View file @
8579ca7c
...
...
@@ -22,13 +22,13 @@ class TestVote:
assert
vote
[
"error"
]
==
0
assert
vote
[
"message"
]
==
param
[
"message1"
]
# 取消点赞,回到取消点赞的状态
canc
le
vote
=
topic_request
()
.
topic_cancelvote
(
param
[
"topic_id"
])
assert
canc
le
vote
[
"error"
]
==
0
canc
el
vote
=
topic_request
()
.
topic_cancelvote
(
param
[
"topic_id"
])
assert
canc
el
vote
[
"error"
]
==
0
else
:
# 如果是已经点过赞的状态就直接取消点赞
canc
le
vote
=
topic_request
()
.
topic_cancelvote
(
param
[
"topic_id"
])
assert
canc
le
vote
[
"error"
]
==
0
assert
canc
le
vote
[
"message"
]
==
param
[
"message2"
]
canc
el
vote
=
topic_request
()
.
topic_cancelvote
(
param
[
"topic_id"
])
assert
canc
el
vote
[
"error"
]
==
0
assert
canc
el
vote
[
"message"
]
==
param
[
"message2"
]
...
...
test_backend_data/topic_data/topic_reply_create.yaml
View file @
8579ca7c
...
...
@@ -2,7 +2,7 @@ reply_create:
-
assert1
:
null
case
:
日记贴一级评论创建--正常校验&创建二级评论--正常校验
channel
:
benzhan
content
:
ces测试+2021-06-18 1
5:31:03
content
:
ces测试+2021-06-18 1
6:41:48
message
:
请勿回复重复内容
message1
:
回复成功
message2
:
你的回复有点频繁,稍后再来
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment