Commit 043bdd63 authored by 林颖's avatar 林颖

其余代码

parent e4a30ede
...@@ -7,9 +7,15 @@ HOSTYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto", "host.yaml") ...@@ -7,9 +7,15 @@ HOSTYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto", "host.yaml")
APYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "account_request.yaml") APYAML_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "account_request.yaml")
LOGIN_VFC = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "login_vfc.yaml") LOGIN_VFC = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "login_vfc.yaml")
#日记本详情页--字段判空
DIARY_DATA_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_data_request.yaml") DIARY_DATA_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_data_request.yaml")
DIARY_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "diary_data.yaml") DIARY_DATA = os.path.join(BASE_DIR, "backend_auto/test_backend_data/account_data", "diary_data.yaml")
#日记本关联美购
DIARY_SERVICE_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "diary_service_request.yaml")
DIARY_SERVICE = os.path.join(BASE_DIR, "backend_auto/test_backend_data/diary", "diary_service.yaml")
#搜索首页-热门搜索 #搜索首页-热门搜索
KEYWORDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml") KEYWORDS_CONFIG = os.path.join(BASE_DIR, "backend_auto/all_backend_api", "search_request.yaml")
......
...@@ -17,6 +17,23 @@ class TestDIARYDATA: ...@@ -17,6 +17,23 @@ class TestDIARYDATA:
# print(1) # print(1)
if r["error"] == 0: if r["error"] == 0:
assert r["error"] == param["assert"] assert r["error"] == param["assert"]
# 先判断有没有日记,然后判断日记本里面需要的那些字段,如点赞字段,日记总数等,不传值,传空值
if r["data"][0]:
assert r["data"][0]["post_date"] is not None and r["data"][0]["post_date"] is not "" #c创建时间
assert r["data"][0]["diary_num"] is not None and r["data"][0]["diary_num"] is not "" #日记总数
assert r["data"][0]["view_count"] is not None and r["data"][0]["view_count"] is not "" #浏览次数
assert r["data"][0]["is_liked"] is not None and r["data"][0]["is_liked"] is not "" #是否点赞
assert r["data"][0]["operation_day"] is not None and r["data"][0]["operation_day"] is not "" #术后多少天
assert r["data"][0]["vote_count"] is not None and r["data"][0]["vote_count"] is not "" #点赞总数
assert r["data"][0]["reply_count"] is not None and r["data"][0]["reply_count"] is not ""#评论总数
assert r["data"][0]["id"] is not None and r["data"][0]["id"] is not ""#日记贴id
# 判断评论列表里面的用户信息是否为空,如果有评论的话
if r["data"][0]["comments"][0]:
assert r["data"][0]["comments"][0]["user_id"] is not None and r["data"][0]["comments"][0]["user_id"] is not ""#用户id
assert r["data"][0]["comments"][0]["nick_name"] is not None and r["data"][0]["comments"][0]["nick_name"] is not ""#用户名
assert r["data"][0]["comments"][0]["gm_url"] is not None and r["data"][0]["comments"][0]["gm_url"] is not ""#点击头像跳转链接
# assert(r[""]) # assert(r[""])
if r["error"] == 1: if r["error"] == 1:
assert r["error"] == param["assert"] assert r["error"] == param["assert"]
......
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