Commit 10bb47ce authored by 张淑琴's avatar 张淑琴

发送私信

parent 0d6e9bee
......@@ -43,6 +43,14 @@ class web_request(BaseRequest):
def service_all(self):
return self.api_send(self.ACCOUNT_URL["service_all"])
def conversation_user_id(self, type, content, doctor_user_id, t, csrfmiddlewaretoken):
self.params["type"] = type
self.params["content"] = content
self.params["doctor_user_id"] = doctor_user_id
self.params["t"] = t
self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
return self.api_send(self.ACCOUNT_URL["conversation_user_id"])
# def file_upload(self, img_type,csrfmiddlewaretoken,id,name,type,lastModifiedDate,size,file):
# self.params["img_type"] = img_type
# self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
......@@ -65,8 +73,8 @@ if __name__ == '__main__':
print(web_request().conversation(0, 1))
print(web_request().conversation_unread_list(1))
print(web_request().service())
print("发送")
print(web_request().conversation_diary(602329))
print(web_request().conversation_coupon(602329))
print(web_request().service_all())
# print(web_request().file_upload("19","PC8uTySuxipukIMuqNV1OPB376C2ZZ3g","WU_FILE_0","lADPDg7mQdiUTiLNAZDNAZA_400_400.jpg_720x720g.jpg","image/jpeg","Mon Apr 26 2021 11:29:45 GMT+0800 (中国标准时间)","17688","(binary)"))
\ No newline at end of file
# print(web_request().file_upload("19","PC8uTySuxipukIMuqNV1OPB376C2ZZ3g","WU_FILE_0","lADPDg7mQdiUTiLNAZDNAZA_400_400.jpg_720x720g.jpg","image/jpeg","Mon Apr 26 2021 11:29:45 GMT+0800 (中国标准时间)","17688","(binary)"))
print(web_request().conversation_user_id(0, "您好", 602329, "271caac2ae1687ca0a56ee18115b8183", "NLeTxEx1BOQo1zjv2us9BQ00ViMAHGpJ"))
\ No newline at end of file
......@@ -106,4 +106,17 @@ service_all:
# size: ${size}
# file: ${file}
# json: {}
# isLogin: 1
\ No newline at end of file
# isLogin: 1
conversation_user_id:
method: post
url: /api/web/conversation/602329_33909952
params: {}
data:
type: ${type}
content: ${content}
doctor_user_id: ${doctor_user_id}
t: ${t}
csrfmiddlewaretoken: ${csrfmiddlewaretoken}
json: {}
isLogin: 1 #需要登录
\ No newline at end of file
develop_host:
backend: http://backend.paas-develop.env
om: http://om.paas-develop.env
# doctor: http://doctor.paas-develop.env
# backend: http://backend.paas-develop.env
# om: http://om.paas-develop.env
doctor: http://doctor.paas-develop.env
# backend: https://backend.igengmei.com
......@@ -337,6 +337,8 @@ SERVICE=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "servic
CONVERSATIONDIARY=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "conversation_diary.yaml")
#医生后台-发送优惠券
CONVERSATIONCOUPON=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "conversation_coupon.yaml")
#医生后台-发送私信
CONVERSATIONUSERID=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "conversation_user_id.yaml")
#更美次卡橱窗组件商品
......
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 TestConversationUserID:
data = BaseRequest().api_load(path_setting.CONVERSATIONUSERID)
userid_case, userid_data = get_ids(data, "conversation_user_id")
@pytest.mark.parametrize("param",userid_data,ids=userid_case)
def test_conversation_user_id(self, param):
'''发送私信'''
r = web_request().conversation_user_id(param["type"], param["content"], param["doctor_user_id"], param["t"], param["csrfmiddlewaretoken"])
print(r)
if r["error"] == 0:
assert r["data"]["name"] == param["assert_name"]
assert r["message"] == param["assert_message"]
if r["error"] == 300009:
assert r["message"] == param["assert_message1"]
# if r["error"] == 300005:
# assert r["message"] == param["assert_message2"]#assert_message2: "该方法未经授权,无法访问"
conversation_user_id:
#发送私信case
-
case: "发送成功"
type: 0
content: 您好
doctor_user_id: 602329
t: 271caac2ae1687ca0a56ee18115b8183
csrfmiddlewaretoken: NLeTxEx1BOQo1zjv2us9BQ00ViMAHGpJ
assert_message: "消息发送成功"
assert_name: "露露2"
- case: "发送失败"
type: 0
content: 您好
doctor_user_id: 6023291
t: 271caac2ae1687ca0a56ee18115b8183
csrfmiddlewaretoken: NLeTxEx1BOQo1zjv2us9BQ00ViMAHGpJ
assert_message1: "没有权限!"
assert_name1: "露露2"
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