Commit 5b994021 authored by zhanhuasheng's avatar zhanhuasheng

bugfix兼容

parent 0d65880d
......@@ -4,7 +4,9 @@ from TestData.inbox.channel_test_data import channelData
channel_select_sql = f'select * from `resource_item` where brand_id = {channelData.brandId} and resource_id in (7,2,3,4,6)' #2:livechat 3:facebook 4:email 6:ins 7:whatsapp
channel_select_result = test_env_conn.select_many_value(sql=channel_select_sql)
channel_id = channel_select_result[0]['id']
channel_name = channel_select_result[0]['name']
channel_name_select_sql = f'select * from `shop` where id = {channel_select_result[0]["rel_id"]}'
channel_name_select_result = test_env_conn.select_one_value(sql=channel_name_select_sql)
channel_name = channel_name_select_result['shop_name']
channel_rel_id = channel_select_result[0]['rel_id']
channel_resource_id = channel_select_result[0]['resource_id']
setattr(channelData, 'channel_id', channel_id)
......@@ -16,18 +18,27 @@ channel_open_room_select_result = test_env_conn.select_many_value(sql=channel_op
setattr(channelData, 'channel_open_room_num', len(channel_open_room_select_result))
setattr(channelData, 'channel_open_room_num_add', len(channel_open_room_select_result) + 1)
customer_service_select_sql = f'select customer_service_id from `rel_customerservice_brand` where brand_id = {channelData.brandId} and is_activation = 1'
customer_service_select_sql = f'select * from `rel_customerservice_brand` where brand_id = {channelData.brandId} and is_delete = 0'
customer_service_select_result = test_env_conn.select_many_value(sql=customer_service_select_sql)
customer_service_id_list = [i['customer_service_id'] for i in customer_service_select_result]
customer_service_id_list = set([i['customer_service_id'] for i in customer_service_select_result])
customer_service_list_select_sql = f'select * from `customer_service` where id in {tuple(customer_service_id_list)} and customer_type = 0'
customer_service_list_select_result = test_env_conn.select_many_value(sql=customer_service_list_select_sql)
customer_service_id = customer_service_list_select_result[0]['id']
end = 0
for cs in customer_service_list_select_result:
for customer in customer_service_select_result:
if customer['customer_service_id'] == cs['id'] and customer['is_activation']:
customer_service_id = customer['customer_service_id']
setattr(channelData, 'customer_service_name', cs['name'])
setattr(channelData, 'customer_service_image', cs['profile'])
setattr(channelData, 'customer_service_email', cs['email'])
end = 1
break
if end:
break
setattr(channelData, 'customer_service_num', len(customer_service_list_select_result))
setattr(channelData, 'customer_service_id', customer_service_id)
setattr(channelData, 'customer_service_name', customer_service_list_select_result[0]['name'])
setattr(channelData, 'customer_service_image', customer_service_list_select_result[0]['profile'])
setattr(channelData, 'customer_service_email', customer_service_list_select_result[0]['email'])
customer_channel_open_room_select_sql = f'select * from `im_room` where site_id = {channel_rel_id} and status = 1 and room_type != 2 and is_ignore = 0 and allocation_uid = {customer_service_id}'
customer_channel_open_room_select_result = test_env_conn.select_many_value(sql=customer_channel_open_room_select_sql)
......
......@@ -92,7 +92,7 @@ api10:
data: {"uid":"${userId}","uType":2,"platform":1,"siteIds":["${shopId}"],"status":1,"page":1,"pageSize":20,"sortName":"all","keyword":"${new_tag_name}","roomSearchExpArgs":{"searchDime":1,"searchId":""},"v":"${v}"}
expected:
- eq: {"$.code": 0}
- eq: {"$.data.list[0].roomId": "${room_id}"}
- in_list: {"data.list[*].roomId": "${room_id}"}
- eq: {"$.data.list[0].searchMatchDimeType": 7}
api11:
......@@ -102,7 +102,7 @@ api11:
data: {"uid":"${userId}","uType":2,"platform":1,"siteIds":["${shopId}"],"status":1,"page":1,"pageSize":20,"sortName":"all","keyword":"${new_tag_name}","roomSearchExpArgs":{"searchDime":2,"searchId":""},"v":"${v}"}
expected:
- eq: {"$.code": 0}
- eq: {"$.data.list[0].roomId": "${room_id}"}
- in_list: {"data.list[*].roomId": "${room_id}"}
- eq: {"$.data.list[0].searchMatchDimeType": 12}
api12:
......@@ -112,7 +112,7 @@ api12:
data: {"uid":"${userId}","uType":2,"platform":1,"siteIds":["${shopId}"],"status":1,"page":1,"pageSize":20,"sortName":"all","keyword":"${new_tag_name}","roomSearchExpArgs":{"searchDime":0,"searchId":""},"v":"${v}"}
expected:
- eq: {"$.code": 0}
- eq: {"$.data.list[0].roomId": "${room_id}"}
- in_list: {"$.data.list[*].roomId": "${room_id}"}
- eq: {"$.data.list[0].searchMatchDimeType": 7}
api13:
......
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