Commit b35c8351 authored by 张淑琴's avatar 张淑琴

未读私信列表

parent 22107234
...@@ -19,7 +19,7 @@ class web_request(BaseRequest): ...@@ -19,7 +19,7 @@ class web_request(BaseRequest):
def conversation(self, is_star, page): def conversation(self, is_star, page):
self.params["is_star"] = is_star self.params["is_star"] = is_star
self.params["page"] = page self.params["page"] = page
return self.api_send(self.data["conversation"]) return self.api_send(self.ACCOUNT_URL["conversation"])
def service_offline(self,id,csrfmiddlewaretoken): def service_offline(self,id,csrfmiddlewaretoken):
...@@ -27,6 +27,10 @@ class web_request(BaseRequest): ...@@ -27,6 +27,10 @@ class web_request(BaseRequest):
self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
return self.api_send(self.ACCOUNT_URL["service_offline"]) return self.api_send(self.ACCOUNT_URL["service_offline"])
def conversation_unread_list(self, page):
self.params["page"] = page
return self.api_send(self.ACCOUNT_URL["conversation_unread_list"])
...@@ -39,4 +43,5 @@ if __name__ == '__main__': ...@@ -39,4 +43,5 @@ if __name__ == '__main__':
print("列表页") print("列表页")
print(web_request().conversation(0, 1)) print(web_request().conversation(0, 1))
print(web_request().service_offline("209992", "PC8uTySuxipukIMuqNV1OPB376C2ZZ3g")) print(web_request().service_offline("209992", "PC8uTySuxipukIMuqNV1OPB376C2ZZ3g"))
print(web_request().conversation_unread_list(1))
...@@ -48,3 +48,12 @@ service_offline: ...@@ -48,3 +48,12 @@ service_offline:
json: {} json: {}
isLogin: 1 isLogin: 1
conversation_unread_list:
method: get
url: /api/web/conversation/unread_list
param:
page: ${page}
data: {}
json: {}
isLogin: 1 #需要登录
...@@ -177,6 +177,8 @@ REPLY_ANSWER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/question_d ...@@ -177,6 +177,8 @@ REPLY_ANSWER = os.path.join(BASE_DIR, "backend_auto/test_backend_data/question_d
#医生后台--全部私信列表 #医生后台--全部私信列表
CONVERSATION = os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "conversation.yaml") CONVERSATION = os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "conversation.yaml")
#医生后台--未读私信列表
CONVERSATIONUNREADLIST = os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "conversation_unread_list.yaml")
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -13,7 +13,7 @@ class TestConversation: ...@@ -13,7 +13,7 @@ class TestConversation:
@pytest.mark.parametrize("param",conversation_data,ids=conversation_case) @pytest.mark.parametrize("param",conversation_data,ids=conversation_case)
def test_conversation(self, param): def test_conversation(self, param):
'''私信列表''' '''全部私信列表'''
r = web_request().conversation(param["is_star"], param["page"]) r = web_request().conversation(param["is_star"], param["page"])
if r["error"] == 0: if r["error"] == 0:
conversation = r.get("data").get("conversation", []) conversation = r.get("data").get("conversation", [])
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_doctor_api.web_request import web_request
class TestConversationUnreadList:
data = BaseRequest().api_load(path_setting.CONVERSATION)
unreadlist_case, unreadlist_data = get_ids(data, "conversation")
@pytest.mark.parametrize("param",unreadlist_data,ids=unreadlist_case)
def test_conversation_unread_list(self, param):
'''全部私信列表'''
r = web_request().conversation_unread_list(param["page"])
if r["error"] == 0:
conversation = r.get("data").get("conversation", [])
assert len(conversation) <= param["assert"]
assert r["data"]["size"] <= param["assert_size"]
conversation_unread_list:
#全部私信case
-
case: "请求成功,有未读消息"
page: 1
assert_size: 10
assert: 10
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