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

清空配置

parent 3c468449
...@@ -15,8 +15,14 @@ class web3_request(BaseRequest): ...@@ -15,8 +15,14 @@ class web3_request(BaseRequest):
self.params["message"] = message self.params["message"] = message
self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
return self.api_send(self.CONVERSATION_ROBOT["conversation_robot_add_message"]) return self.api_send(self.CONVERSATION_ROBOT["conversation_robot_add_message"])
def conversation_robot_clean_message(self, doctor_user_id, csrfmiddlewaretoken):
#清空私信机器人配置
self.params["doctor_user_id"] = doctor_user_id
self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
return self.api_send(self.CONVERSATION_ROBOT["conversation_robot_clean_message"])
if __name__ == '__main__': if __name__ == '__main__':
print(web3_request().conversation_robot_get_page()) print(web3_request().conversation_robot_get_page())
print(web3_request().conversation_robot_add_message('{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"0","content":"测试"}]}],"personality":[]}', "qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk")) print(web3_request().conversation_robot_add_message('{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"0","content":"测试"}]}],"personality":[]}', "qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"))
print(web3_request().conversation_robot_clean_message("602329", "qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"))
conversation_robot_get_page: conversation_robot_get_page:
#获取页面类型
method: get method: get
url: /api/web3/conversation/robot/get_page url: /api/web3/conversation/robot/get_page
params: {} params: {}
...@@ -8,6 +9,7 @@ conversation_robot_get_page: ...@@ -8,6 +9,7 @@ conversation_robot_get_page:
isLogin: 1 #需要登录 isLogin: 1 #需要登录
conversation_robot_add_message: conversation_robot_add_message:
#添加私信机器人配置
method: post method: post
url: /api/web3/conversation/robot/add_message url: /api/web3/conversation/robot/add_message
params: {} params: {}
...@@ -15,4 +17,15 @@ conversation_robot_add_message: ...@@ -15,4 +17,15 @@ conversation_robot_add_message:
message: ${message} message: ${message}
csrfmiddlewaretoken: ${csrfmiddlewaretoken} csrfmiddlewaretoken: ${csrfmiddlewaretoken}
json: {} json: {}
isLogin: 1 #需要登录
conversation_robot_clean_message:
#清空私信配置
method: post
url: /api/web3/conversation/robot/clean_message
params: {}
data:
doctor_user_id: ${doctor_user_id}
csrfmiddlewaretoken: ${csrfmiddlewaretoken}
json: {}
isLogin: 1 #需要登录 isLogin: 1 #需要登录
\ No newline at end of file
...@@ -503,8 +503,13 @@ CONVERSATIONUSERID=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_dat ...@@ -503,8 +503,13 @@ CONVERSATIONUSERID=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_dat
#医生后台-私信机器人 #医生后台-私信机器人
CONVERSATION_ROBOT = os.path.join(BASE_DIR, "backend_auto/all_doctor_api", "web3_request.yaml") CONVERSATION_ROBOT = os.path.join(BASE_DIR, "backend_auto/all_doctor_api", "web3_request.yaml")
#医生后台-获取页面类型
ROBOTGETPAGE= os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web3_data", "conversation_robot_get_page.yaml") ROBOTGETPAGE= os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web3_data", "conversation_robot_get_page.yaml")
#医生后台-添加私信配置
ROBOTADDMESSAGE= os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web3_data", "conversation_robot_add_message.yaml") ROBOTADDMESSAGE= os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web3_data", "conversation_robot_add_message.yaml")
#医生后台-清空私信配置
ROBOTCLEANMESSAGE= os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web3_data", "conversation_robot_clean_message.yaml")
#医生后台-服务资源 #医生后台-服务资源
......
import pytest
from ids_list import get_ids
import path_setting
from in_common.base_request import BaseRequest
from all_doctor_api.web3_request import web3_request
class TestConversationRobotCleanMessage:
data = BaseRequest().api_load(path_setting.ROBOTCLEANMESSAGE)
robot_clean_message_case, robot_clean_message_data = get_ids(data, "conversation_robot_clean_message")
@pytest.mark.parametrize("param",robot_clean_message_data,ids=robot_clean_message_case)
def test_conversation_robot_clean_message(self, param):
'''私信机器人-添加私信配置'''
r = web3_request().conversation_robot_clean_message(param["doctor_user_id"], param["csrfmiddlewaretoken"])
if r["error"] == 0:
assert r["message"] == param["assert"]
...@@ -73,3 +73,40 @@ conversation_robot_add_message: ...@@ -73,3 +73,40 @@ conversation_robot_add_message:
csrfmiddlewaretoken: "qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk" csrfmiddlewaretoken: "qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert: "配置成功" assert: "配置成功"
-
case: "私信机器人-默认配置文本+个性配置商详页眼科-文本+图片"
message: '{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"0","content":"这是默认配置"}]}],"personality":[{"name":"商详页","page_type":"1","tag_id":12711,"doctor_user_id":602329,"msg_list":[{"id":"","type":"0","content":"商详页文案"},{"id":"","type":"2","content":"https://heras.igengmei.com/service/2021/08/20/a008207781"}]}]}'
csrfmiddlewaretoken: "qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert: "配置成功"
-
case: "私信机器人-默认配置文本+个性配置商详页眼科-文本+图片+优惠券"
message: '{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"0","content":"这是默认配置"}]}],"personality":[{"name":"商详页","page_type":"1","tag_id":12711,"doctor_user_id":602329,"msg_list":[{"id":"","type":"0","content":"商详页文案"},{"id":"","type":"2","content":"https://heras.igengmei.com/service/2021/08/20/a008207781"},{"id":"","type":"9","content":"59055,51"}]}]}'
csrfmiddlewaretoken: "qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert: "配置成功"
-
case: "私信机器人-默认配置文本+个性配置商详页眼科-文本+图片+优惠券+敏感词"
message: '{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"0","content":"这是默认配置"}]}],"personality":[{"name":"商详页","page_type":"1","tag_id":12711,"doctor_user_id":602329,"msg_list":[{"id":"","type":"0","content":"商详页文案"},{"id":"","type":"2","content":"https://heras.igengmei.com/service/2021/08/20/a008207781"},{"id":"","type":"9","content":"59055,51"},{"id":"","type":"0","content":"敏感词微信"}]}]}'
csrfmiddlewaretoken: "qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert: "配置成功"
-
case: "私信机器人-默认配置文本+个性配置商详页眼科-文本+医生主页文本"
message: '{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"0","content":"这是默认配置"}]}],"personality":[{"name":"商详页","page_type":"1","tag_id":12711,"doctor_user_id":602329,"msg_list":[{"id":"","type":"0","content":"商详页文案"},{"id":"","type":"2","content":"https://heras.igengmei.com/service/2021/08/20/a008207781"},{"id":"","type":"9","content":"59055,51"}]},{"name":"医生主页","page_type":"3","tag_id":"","doctor_user_id":602329,"msg_list":[{"id":"","type":"0","content":"医生主页文案"}]}]}'
csrfmiddlewaretoken: "qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert: "配置成功"
-
case: "私信机器人-默认配置文本+个性配置商详页眼科-文本+医生主页文本+机构主页文本"
message: '{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"0","content":"这是默认配置"}]}],"personality":[{"name":"商详页","page_type":"1","tag_id":12711,"doctor_user_id":602329,"msg_list":[{"id":"","type":"0","content":"商详页文案"},{"id":"","type":"2","content":"https://heras.igengmei.com/service/2021/08/20/a008207781"},{"id":"","type":"9","content":"59055,51"}]},{"name":"医生主页","page_type":"3","tag_id":"","doctor_user_id":602329,"msg_list":[{"id":"","type":"0","content":"医生主页文案"}]},{"name":"机构主页","page_type":"2","tag_id":"","doctor_user_id":602329,"msg_list":[{"id":"","type":"0","content":"机构主页文案"}]}]}'
csrfmiddlewaretoken: "qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert: "配置成功"
-
case: "私信机器人-默认配置文本+个性配置商详页三个类目-文本+医生机构主页配置"
message: '{"default":[{"name":"","page_type":"0","tag_id":"","tag_name":"","doctor_user_id":602329,"msg_list":[{"id":168,"type":"0","content":"这是默认配置"}]}],"personality":[{"name":"商详页","page_type":"1","tag_id":12711,"doctor_user_id":602329,"msg_list":[{"id":"","type":"0","content":"商详页文案"},{"id":"","type":"2","content":"https://heras.igengmei.com/service/2021/08/20/a008207781"},{"id":"","type":"9","content":"59055,51"}]},{"name":"医生主页","page_type":"3","tag_id":"","doctor_user_id":602329,"msg_list":[{"id":"","type":"0","content":"医生主页文案"}]},{"name":"机构主页","page_type":"2","tag_id":"","doctor_user_id":602329,"msg_list":[{"id":"","type":"0","content":"机构主页文案"}]},{"name":"商详页","page_type":"1","tag_id":2,"doctor_user_id":602329,"msg_list":[{"id":"","type":"0","content":"商详页-鼻部整形"}]},{"name":"商详页","page_type":"1","tag_id":1,"doctor_user_id":602329,"msg_list":[{"id":"","type":"0","content":"商详页-眼部整形"}]}]}'
csrfmiddlewaretoken: "qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert: "配置成功"
conversation_robot_clean_message:
#私信机器人-清空私信配置
-
case: "私信机器人-清空私信配置"
doctor_user_id: "602329"
csrfmiddlewaretoken: "qzDd1CYV1LngDvQaGjgq4gKoHOPyieHk"
assert: "清空成功"
\ No newline at end of file
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