Commit b29ad28f authored by zhanhuasheng's avatar zhanhuasheng

bugfix

parent 6fc536b4
......@@ -15,6 +15,8 @@ class shopifyIntegrationData(Global):
append_shop_currency = ''
append_shop_connect_status = 1
shop_source = 2
append_js_shop_name = 'autotest_js_shop'
append_js_shop_url = 'autotest_js_shop.shopify.com'
js_soucrce = 1
active_shop_email = 'zhanhuasheng@channelwill.cn'
new_workspance_name = 'autotest_workspace'
......
......@@ -7,7 +7,7 @@ shopify_shop_insert_sql = f"""INSERT INTO willdesk.shop (company_id,brand_id,`so
"""
new_shop_select_sql = f'select * from `shop` where brand_id = {shopifyIntegrationData.brandId} and shop_name = "{shopifyIntegrationData.append_shop_name}" and shop_domain = "{shopifyIntegrationData.append_shop_url}" and is_delete in (0,2) and `source` = {shopifyIntegrationData.shop_source}'
js_shop_insert_sql = f"""INSERT INTO willdesk.shop (company_id,brand_id,`source`,shop_name,website_name,shop_domain,shop_url,shop_owner,phone,email,install_email,third_id,third_token,third_plan,money_format,time_zone,country,country_code,currency,province,city,address,zip,is_review,reviews,`language`,connect_status,shop_js,integrated_email,theme_id,theme_ext_version,faq_willdesk_doamin,faq_cname_domain,embedding_switch,embedding_check_time,is_delete,uninstall_time,create_at,update_at,integration_rdc) VALUES
({shopifyIntegrationData.companyId},{shopifyIntegrationData.brandId},{shopifyIntegrationData.js_soucrce},'{shopifyIntegrationData.append_shop_name}','','{shopifyIntegrationData.append_shop_url}','','','',{shopifyIntegrationData.append_shop_email},'','{shopifyIntegrationData.append_third_id}','','','','','','','{shopifyIntegrationData.append_shop_currency}','','','','',0,0,'',{shopifyIntegrationData.append_shop_connect_status},'{shopifyIntegrationData.append_shop_js}',{shopifyIntegrationData.append_integrated_email},0,'v1','{shopifyIntegrationData.append_faq_willdesk_domain}',{shopifyIntegrationData.append_faq_cname_domain},1,'2024-04-23 17:18:55',2,NULL,'2024-04-23 17:18:55','2024-04-23 17:18:55',0);
({shopifyIntegrationData.companyId},{shopifyIntegrationData.brandId},{shopifyIntegrationData.js_soucrce},'{shopifyIntegrationData.append_js_shop_name}','','{shopifyIntegrationData.append_js_shop_url}','','','',{shopifyIntegrationData.append_shop_email},'','{shopifyIntegrationData.append_third_id}','','','','','','','{shopifyIntegrationData.append_shop_currency}','','','','',0,0,'',{shopifyIntegrationData.append_shop_connect_status},'{shopifyIntegrationData.append_shop_js}',{shopifyIntegrationData.append_integrated_email},0,'v1','{shopifyIntegrationData.append_faq_willdesk_domain}',{shopifyIntegrationData.append_faq_cname_domain},1,'2024-04-23 17:18:55',2,NULL,'2024-04-23 17:18:55','2024-04-23 17:18:55',0);
"""
new_js_select_sql = f'select * from `shop` where brand_id = {shopifyIntegrationData.brandId} and shop_name = "{shopifyIntegrationData.append_shop_name}" and shop_domain = "{shopifyIntegrationData.append_shop_url}" and is_delete in (0,2) and `source` = {shopifyIntegrationData.js_soucrce}'
......@@ -37,8 +37,8 @@ if shopify_shop_select_result:
new_js_select_result = test_env_conn.select_one_value(sql=new_js_select_sql)
append_js_id = new_shop_select_result['id']
setattr(shopifyIntegrationData, 'append_js_id', append_js_id)
shop_num = len(test_env_conn.select_many_value(sql=shopify_shop_select_sql))
setattr(shopifyIntegrationData, 'shop_num', shop_num)
shop_num_result = test_env_conn.select_many_value(sql=shopify_shop_select_sql)
setattr(shopifyIntegrationData, 'shop_num', len(shop_num_result))
else:
test_env_conn.execute_sql(sql=shopify_shop_insert_sql)
new_shop_select_result = test_env_conn.select_one_value(sql=new_shop_select_sql)
......@@ -60,7 +60,8 @@ else:
shop_id = append_shop_id
setattr(shopifyIntegrationData, 'append_shop_id', append_shop_id)
setattr(shopifyIntegrationData, 'append_js_id', append_js_id)
setattr(shopifyIntegrationData, 'shop_num', 2)
shop_num_result = test_env_conn.select_many_value(sql=shopify_shop_select_sql)
setattr(shopifyIntegrationData, 'shop_num', len(shop_num_result))
setattr(shopifyIntegrationData, 'shop_id', shop_id)
setattr(shopifyIntegrationData, 'shop_brand_id', shop_brand_id)
setattr(shopifyIntegrationData, 'shop_company_id', shop_company_id)
......
......@@ -11,7 +11,7 @@ api2:
title: 更改账户名
url: /api/v1/customerService/updateCustomerServiceAccount
method: post
data: {"id" : "${userId}" , "localLang" : "zh-CN" ,"name" : "${new_name}" , "profile" : "${picUrl}", "v" : "${v}"}
data: {"id" : "${userId}" , "localLang" : "${origin_language}" ,"name" : "${new_name}" , "profile" : "${picUrl}", "v" : "${v}"}
expected:
- eq: {"$.code" : 0}
- eq: {"$.msg" : "success"}
......@@ -30,8 +30,8 @@ api4:
url: /api/v1/customerService/getCustomerServiceInfo?v=${v}
method: get
expected:
- eq: { "$.code": 0 }
- eq: { "$.data.name": "${new_name}" }
- eq: {"$.code": 0 }
- eq: {"$.data.name": "${new_name}" }
api5:
title: 检查用户名 - inbox页面检查资源列表接口
......@@ -86,4 +86,3 @@ api10:
data: {"id" : "${userId}" , "localLang" : "${origin_language}" ,"name" : "${old_name}", "profile" : "${picUrl}", "v" : "${v}"}
expected:
- eq: {"$.code" : 0}
- eq: {"$.msg" : "success"}
......@@ -11,7 +11,7 @@ api2:
title: 新增shopify - js集成
url: /api/v1/shop/add
method: post
data: {"domain": "${append_shop_url}","shopName": "${append_shop_name}","source": 1,"v": "${v}" }
data: {"domain": "${append_js_shop_url}","shopName": "${append_js_shop_name}","source": 1,"v": "${v}" }
set_value: {"append_js_id": "$.data.id"}
expected:
- eq: { "$.code": 0 }
......
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