Commit 398ec3ea authored by 林颖's avatar 林颖

医生后台--修改密码相关

parent 6e7d6c39
...@@ -25,11 +25,39 @@ class web_request(BaseRequest): ...@@ -25,11 +25,39 @@ class web_request(BaseRequest):
self.params["phone"] = phone self.params["phone"] = phone
return self.api_send(self.ACCOUNT_URL["doctor_verificationcode"]) return self.api_send(self.ACCOUNT_URL["doctor_verificationcode"])
# 医生后台-商户管理-医生管理列表--创建医生上传头像图片 # 医生后台-商户管理-医生管理列表--创建医生上传头像图片--暂时还没写case待定
def file_upload(self,phone): def file_upload(self,phone):
self.params["phone"] = phone self.params["phone"] = phone
return self.api_send(self.ACCOUNT_URL["file_upload"]) return self.api_send(self.ACCOUNT_URL["file_upload"])
# 医生后台-商户管理-医生管理列表--查看审核中的医生
def doctor_register(self,doctorregister_id):
self.params["doctorregister_id"] = doctorregister_id
return self.api_send(self.ACCOUNT_URL["doctor_register"])
# 医生后台-密码登录
def account_login(self,name, password, method='password' ):
self.params["name"] = name
self.params["password"] = password
self.params["method"] = method
return self.api_send(self.ACCOUNT_URL["account_login"])
# 医生后台-修改密码发送验证码
def account_code_online(self,csrfmiddlewaretoken ):
self.params["csrfmiddlewaretoken"] = csrfmiddlewaretoken
return self.api_send(self.ACCOUNT_URL["account_code_online"])
# 医生后台-修改密码
def account_password(self,new_password, code='' ):
self.params["new_password"] = new_password
# code = self.xxx() # 待会补上方法
self.params["code"] = code
return self.api_send(self.ACCOUNT_URL["account_password"])
def service_offline(self,id,csrfmiddlewaretoken): def service_offline(self,id,csrfmiddlewaretoken):
......
...@@ -247,4 +247,50 @@ file_upload: ...@@ -247,4 +247,50 @@ file_upload:
params: {} params: {}
data: {} data: {}
json: {} json: {}
isLogin: 1 #需要登录 isLogin: 1 #需要登录
\ No newline at end of file
#医生后台-商户管理-医生管理列表--查看审核中的医生
doctor_register:
method: get
url: /api/web/doctor/register
params:
doctorregister_id: ${doctorregister_id}
data: {}
json: {}
isLogin: 1 #需要登录
#医生后台-账号密码登录
account_login:
method: post
url: /api/web/account/login
params: {}
data:
name: ${name}
password: ${password}
method: ${method}
json: {}
#医生后台-修改密码发送验证码
account_code_online:
method: post
url: /api/web/account/code/online
params: {}
data:
csrfmiddlewaretoken: ${csrfmiddlewaretoken}
json: {}
isLogin: 1
#医生后台-修改密码
account_password:
method: post
url: /api/web/account/password
params: {}
data:
new_password: ${new_password}
code: ${code}
json: {}
isLogin: 1
...@@ -170,6 +170,17 @@ KEYWORDS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data", ...@@ -170,6 +170,17 @@ KEYWORDS = os.path.join(BASE_DIR, "backend_auto/test_backend_data/search_data",
DOCTORLIST = os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "doctor_doctorlist.yaml") DOCTORLIST = os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "doctor_doctorlist.yaml")
# 医生后台-商户管理-医生管理列表--创建医生发送验证码 # 医生后台-商户管理-医生管理列表--创建医生发送验证码
DOCTOR_VERIIFICATIONCODE = os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "doctor_verificationcode.yaml") DOCTOR_VERIIFICATIONCODE = os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "doctor_verificationcode.yaml")
# 医生后台-商户管理-医生管理列表--审核中的医生查看
DOCTOR_REGISTER = os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "doctor_register.yaml")
# 医生后台-账号密码登录
DOCTOR_LOGIN = os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "account_login.yaml")
# 医生后台-修改密码--发送验证码
DOCTOR_CODE_ONLINE = os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "account_code_online.yaml")
# 医生后台-修改密码
DOCTOR_PASSWORD = os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web_data", "account_password.yaml")
#医生后台-我的商品 #医生后台-我的商品
SERVICE_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "service_list.yaml") SERVICE_DATA=os.path.join(BASE_DIR, "backend_auto/test_doctor_data/web2_data", "service_list.yaml")
......
import pytest
import path_setting
from all_doctor_api.web_request import web_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestAccountCodeOnline:
data = BaseRequest().api_load(path_setting.DOCTOR_CODE_ONLINE)
account_code_online_case, account_code_online_data = get_ids(data, "account_code_online")
@pytest.mark.parametrize("param",account_code_online_data,ids=account_code_online_case)
def test_account_code_online(self,param):
r = web_request().account_code_online(param["csrfmiddlewaretoken"])
assert r["error"] == param["error"]
assert r["message"] == param["message"]
import pytest
import path_setting
from all_doctor_api.web_request import web_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestAccountLogin:
data = BaseRequest().api_load(path_setting.DOCTOR_LOGIN)
account_login_case, account_login_data = get_ids(data, "account_login")
@pytest.mark.parametrize("param",account_login_data,ids=account_login_case)
def test_account_login(self,param):
r = web_request().account_login(param["name"],param["password"])
assert r["error"] == param["error"]
assert r["message"] == param["message"]
import pytest
import path_setting
from all_doctor_api.web_request import web_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestAccountPassword:
data = BaseRequest().api_load(path_setting.DOCTOR_PASSWORD)
account_password_case, account_password_data = get_ids(data, "account_password")
@pytest.mark.parametrize("param",account_password_data,ids=account_password_case)
def test_account_password(self,param):
r = web_request().account_password(param["new_password"], param["code"])
assert r["error"] == param["error"]
assert r["message"] == param["message"]
import pytest
import path_setting
from all_doctor_api.web_request import web_request
from ids_list import get_ids
from in_common.base_request import BaseRequest
class TestDoctorRegister:
data = BaseRequest().api_load(path_setting.DOCTOR_REGISTER)
doctor_register_case, doctor_register_data = get_ids(data, "doctor_register")
@pytest.mark.parametrize("param",doctor_register_data,ids=doctor_register_case)
def test_doctor_register(self,param):
r = web_request().doctor_register(param["doctorregister_id"])
if r["error"] == 0:
assert r["error"] == param["assert"]
assert r["data"]['register_phone'] is not None and r["data"]['register_phone'] is not "" # 校验注册手机号不为空
assert r["data"]['department'] is not None and r["data"]['department'] is not "" # 校验所在科室不为空
assert r["data"]['good_at'] is not None and r["data"]['good_at'] is not "" # 校验项目不为空
assert r["data"]['name'] is not None and r["data"]['name'] is not "" # 校验名字不为空
assert r["data"]['professional_certificate_num'] is not None and r["data"]['professional_certificate_num'] is not "" # 校验证书不为空
# elif r["error"] == 1:
# assert r["message"] == params["assert"]
\ No newline at end of file
account_code_online:
-
case: "医生后台-修改密码发送验证码 "
error: 0
csrfmiddlewaretoken: 'ICODxWkFPFGlGAX7cwzeXeszBnHzADuK'
message: '验证码已发送至您的手机'
#13221031104
account_login:
-
case: "医生后台-账号密码登录--密码错误导致的登录失败 "
error: 70002
name: 12345654321
password: 123451
message: '登陆失败'
-
case: "医生后台-账号密码登录--账号不存在导致的登录失败 "
error: 30003
name: 123456543211
password: 123451
message: '医生未申请审核加入'
-
case: "医生后台-账号密码登录--登录成功 "
error: 0
name: 12345678912
password: 123456
message: ""
account_password:
# 判断条件是先看密码在看验证码,所以先判断密码,验证码能判断不符合的
-
case: "医生后台-修改密码--密码格式不符合--全数字 "
error: 22007
new_password: 123456
code: 123451
message: '新密码不符合要求,请重新输入'
-
case: "医生后台-修改密码--密码格式不符合--全字母 "
error: 22007
new_password: aaaaaaaa
code: 123451
message: '新密码不符合要求,请重新输入'
-
case: "医生后台-修改密码--密码格式不符合--混合但少于6位 "
error: 22007
new_password: 1234w
code: 123451
message: '新密码不符合要求,请重新输入'
-
case: "医生后台-修改密码--密码格式不符合--混合但是多于16位 "
error: 22007
new_password: 1234567890123456a
code: 123451
message: '新密码不符合要求,请重新输入'
-
case: "医生后台-修改密码--密码格式不符合--验证码不符合 "
error: 22001
new_password: '12345a'
code: 123451
message: '错误的验证码'
doctor_register:
-
case: "医生后台-商户管理-医生管理列表--查看审核中的医生 "
assert: 0
doctorregister_id: 24086
\ 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