加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
test_updateUser.py 26.54 KB
一键复制 编辑 原始数据 按行查看 历史
末日流光 提交于 2023-11-28 18:37 . 接口自动化测试
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
import unittest
from ddt import ddt,data,unpack
import requests
import Common
@ddt
class UpdateUserTest(unittest.TestCase):
test = "test"
finish = "finish"
testTxt = "测好了"
db=""
cursor=""
url="http://localhost:90/user/updateUserProfile"
login_url="http://localhost:90/login/verifyLogin"
@classmethod
def setUpClass(self):
self.db,self.cursor=Common.connectMysql()
@classmethod
def tearDownClass(self):
Common.closeMysql(self.db,self.cursor)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username":"testlisi","password":"123456","username2":"testlisi","password2":"123456","realname":"李四","idcard":"333890950506954816","paypwd":666666,"phone":"54392600993","email":"1542043225@qq.com","realname2": "李四一", "idcard2":"855745919747169214", "paypwd2":"123457","phone2":"15527756021","email2":"1542043226@qq.com"},{"status":200,"code":100}])
def test_01_normal_user_update(self,values,targets):
username=values["username"]
password=values["password"]
username2 = values["username2"]
password2 = values["password2"]
realname = values["realname"]
idcard = values["idcard"]
paypwd = values["paypwd"]
phone = values["phone"]
email = values["email"]
password=Common.getEncryptPassword(self.db,self.cursor,password)
password2 =Common.getEncryptPassword(self.db,self.cursor,password2)
user = (
username, realname, password, idcard,
phone,
email, paypwd, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
user = Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2)
userDetail=[username,realname,password2,idcard,phone,email,paypwd,1,"良好"]
Common.checkUserDetail(self.db,self.cursor,user,userDetail)
params={}
params["username"]=username2
params["password"]= password2
login_req=requests.get(self.login_url,params=params)
cookies=login_req.cookies
cookie=""
for k, v in cookies.items():
cookie+=k+"="+v+";"
headers = {
'Cookie': cookie,
}
realname2 = values["realname2"]
idcard2 = values["idcard2"]
paypwd2 = values["paypwd2"]
phone2 = values["phone2"]
email2 = values["email2"]
params={}
params["realname"] = realname2
params["idcard"] = idcard2
params["paypwd"] = paypwd2
params["phone"] = phone2
params["email"] = email2
self.url=self.url+"/"+str(user[0][0])
req=requests.put(self.url,params=params,headers=headers)
req.encoding="UTF-8"
status=req.status_code
res=req.json()
code=res["code"]
self.assertEqual(targets["status"],status)
self.assertEqual(targets["code"],code)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username":"testlisi","password":"123456","username2":"testlisi","password2":"123456","realname":"李四","idcard":"333890950506954816","paypwd":666666,"phone":"54392600993","email":"1542043225@qq.com","realname2": "李四一", "idcard2":"855745919747169214", "paypwd2":"123457","phone2":"15527756021","email2":"1542043226@qq.com","sex":"男"},{"status":400,"code":""}])
def test_02_normal_MoreParams_update(self,values,targets):
username=values["username"]
password=values["password"]
username2 = values["username2"]
password2 = values["password2"]
realname = values["realname"]
idcard = values["idcard"]
paypwd = values["paypwd"]
phone = values["phone"]
email = values["email"]
password=Common.getEncryptPassword(self.db,self.cursor,password)
password2 =Common.getEncryptPassword(self.db,self.cursor,password2)
user = (
username, realname, password, idcard,
phone,
email, paypwd, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
user = Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2)
userDetail=[username,realname,password2,idcard,phone,email,paypwd,1,"良好"]
Common.checkUserDetail(self.db,self.cursor,user,userDetail)
params={}
params["username"]=username2
params["password"]= password2
login_req=requests.get(self.login_url,params=params)
cookies=login_req.cookies
cookie=""
for k, v in cookies.items():
cookie+=k+"="+v+";"
headers = {
'Cookie': cookie,
}
realname2 = values["realname2"]
idcard2 = values["idcard2"]
paypwd2 = values["paypwd2"]
phone2 = values["phone2"]
email2 = values["email2"]
params={}
params["realname"] = realname2
params["idcard"] = idcard2
params["paypwd"] = paypwd2
params["phone"] = phone2
params["email"] = email2
params["sex"] = values["sex"]
self.url=self.url+"/"+str(user[0][0])
req=requests.put(self.url,params=params,headers=headers)
req.encoding="UTF-8"
status=req.status_code
res=req.json()
code=res["code"]
self.assertEqual(targets["status"],status)
self.assertEqual(targets["code"],code)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username":"testlisi","password":"123456","username2":"testlisi","password2":"123456","realname":"李四","idcard":"333890950506954816","paypwd":666666,"phone":"54392600993","email":"1542043225@qq.com","realname2": "李四一", "idcard2":"855745919747169214", "paypwd2":"123457","phone2":"15527756021","email2":"1542043226@qq.com","sex":""},{"status":400,"code":""}])
def test_03_normal_lackRealname_update(self,values,targets):
username=values["username"]
password=values["password"]
username2 = values["username2"]
password2 = values["password2"]
realname = values["realname"]
idcard = values["idcard"]
paypwd = values["paypwd"]
phone = values["phone"]
email = values["email"]
password=Common.getEncryptPassword(self.db,self.cursor,password)
password2 =Common.getEncryptPassword(self.db,self.cursor,password2)
user = (
username, realname, password, idcard,
phone,
email, paypwd, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
user = Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2)
userDetail=[username,realname,password2,idcard,phone,email,paypwd,1,"良好"]
Common.checkUserDetail(self.db,self.cursor,user,userDetail)
params={}
params["username"]=username2
params["password"]= password2
login_req=requests.get(self.login_url,params=params)
cookies=login_req.cookies
cookie=""
for k, v in cookies.items():
cookie+=k+"="+v+";"
headers = {
'Cookie': cookie,
}
realname2 = values["realname2"]
idcard2 = values["idcard2"]
paypwd2 = values["paypwd2"]
phone2 = values["phone2"]
email2 = values["email2"]
params={}
params["idcard"] = idcard2
params["paypwd"] = paypwd2
params["phone"] = phone2
params["email"] = email2
self.url=self.url+"/"+str(user[0][0])
req=requests.put(self.url,params=params,headers=headers)
req.encoding="UTF-8"
status=req.status_code
res=req.json()
code=res["code"]
self.assertEqual(targets["status"],status)
self.assertEqual(targets["code"],code)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username":"testlisi","password":"123456","username2":"testlisi","password2":"123456","realname":"李四","idcard":"333890950506954816","paypwd":666666,"phone":"54392600993","email":"1542043225@qq.com","realname2": "李四一", "idcard2":"855745919747169214", "paypwd2":"123457","phone2":"15527756021","email2":"1542043226@qq.com","sex":""},{"status":400,"code":""}])
def test_04_normal_lackidcard_update(self,values,targets):
username=values["username"]
password=values["password"]
username2 = values["username2"]
password2 = values["password2"]
realname = values["realname"]
idcard = values["idcard"]
paypwd = values["paypwd"]
phone = values["phone"]
email = values["email"]
password=Common.getEncryptPassword(self.db,self.cursor,password)
password2 =Common.getEncryptPassword(self.db,self.cursor,password2)
user = (
username, realname, password, idcard,
phone,
email, paypwd, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
user = Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2)
userDetail=[username,realname,password2,idcard,phone,email,paypwd,1,"良好"]
Common.checkUserDetail(self.db,self.cursor,user,userDetail)
params={}
params["username"]=username2
params["password"]= password2
login_req=requests.get(self.login_url,params=params)
cookies=login_req.cookies
cookie=""
for k, v in cookies.items():
cookie+=k+"="+v+";"
headers = {
'Cookie': cookie,
}
realname2 = values["realname2"]
idcard2 = values["idcard2"]
paypwd2 = values["paypwd2"]
phone2 = values["phone2"]
email2 = values["email2"]
params={}
params["realname"] = realname2
params["paypwd"] = paypwd2
params["phone"] = phone2
params["email"] = email2
self.url=self.url+"/"+str(user[0][0])
req=requests.put(self.url,params=params,headers=headers)
req.encoding="UTF-8"
status=req.status_code
res=req.json()
code=res["code"]
self.assertEqual(targets["status"],status)
self.assertEqual(targets["code"],code)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username": "testlisi", "password": "123456", "username2": "testlisi", "password2": "123456",
"realname": "李四", "idcard": "333890950506954816", "paypwd": 666666, "phone": "54392600993",
"email": "1542043225@qq.com", "realname2": "李四一", "idcard2": "855745919747169214", "paypwd2": "123457",
"phone2": "15527756021", "email2": "1542043226@qq.com", "sex": ""}, {"status": 400, "code": ""}])
def test_05_normal_lackpaypwd_update(self, values, targets):
username = values["username"]
password = values["password"]
username2 = values["username2"]
password2 = values["password2"]
realname = values["realname"]
idcard = values["idcard"]
paypwd = values["paypwd"]
phone = values["phone"]
email = values["email"]
password = Common.getEncryptPassword(self.db, self.cursor, password)
password2 = Common.getEncryptPassword(self.db, self.cursor, password2)
user = (
username, realname, password, idcard,
phone,
email, paypwd, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
user = Common.getUserByUsernameAndPassword(self.db, self.cursor, username2, password2)
userDetail = [username, realname, password2, idcard, phone, email, paypwd, 1, "良好"]
Common.checkUserDetail(self.db, self.cursor, user, userDetail)
params = {}
params["username"] = username2
params["password"] = password2
login_req = requests.get(self.login_url, params=params)
cookies = login_req.cookies
cookie = ""
for k, v in cookies.items():
cookie += k + "=" + v + ";"
headers = {
'Cookie': cookie,
}
realname2 = values["realname2"]
idcard2 = values["idcard2"]
paypwd2 = values["paypwd2"]
phone2 = values["phone2"]
email2 = values["email2"]
params = {}
params["realname"] = realname2
params["idcard"] = idcard2
params["phone"] = phone2
params["email"] = email2
self.url = self.url + "/" + str(user[0][0])
req = requests.put(self.url, params=params, headers=headers)
req.encoding = "UTF-8"
status = req.status_code
res = req.json()
code = res["code"]
self.assertEqual(targets["status"], status)
self.assertEqual(targets["code"], code)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username":"testlisi","password":"123456","username2":"testlisi","password2":"123456","realname":"李四","idcard":"333890950506954816","paypwd":666666,"phone":"54392600993","email":"1542043225@qq.com","realname2": "李四一", "idcard2":"855745919747169214", "paypwd2":"123457","phone2":"15527756021","email2":"1542043226@qq.com","sex":""},{"status":400,"code":""}])
def test_06_normal_lackphone_update(self,values,targets):
username=values["username"]
password=values["password"]
username2 = values["username2"]
password2 = values["password2"]
realname = values["realname"]
idcard = values["idcard"]
paypwd = values["paypwd"]
phone = values["phone"]
email = values["email"]
password=Common.getEncryptPassword(self.db,self.cursor,password)
password2 =Common.getEncryptPassword(self.db,self.cursor,password2)
user = (
username, realname, password, idcard,
phone,
email, paypwd, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
user = Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2)
userDetail=[username,realname,password2,idcard,phone,email,paypwd,1,"良好"]
Common.checkUserDetail(self.db,self.cursor,user,userDetail)
params={}
params["username"]=username2
params["password"]= password2
login_req=requests.get(self.login_url,params=params)
cookies=login_req.cookies
cookie=""
for k, v in cookies.items():
cookie+=k+"="+v+";"
headers = {
'Cookie': cookie,
}
realname2 = values["realname2"]
idcard2 = values["idcard2"]
paypwd2 = values["paypwd2"]
phone2 = values["phone2"]
email2 = values["email2"]
params={}
params["realname"] = realname2
params["idcard"] = idcard2
params["paypwd"] = paypwd2
params["email"] = email2
self.url=self.url+"/"+str(user[0][0])
req=requests.put(self.url,params=params,headers=headers)
req.encoding="UTF-8"
status=req.status_code
res=req.json()
code=res["code"]
self.assertEqual(targets["status"],status)
self.assertEqual(targets["code"],code)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username": "testlisi", "password": "123456", "username2": "testlisi", "password2": "123456",
"realname": "李四", "idcard": "333890950506954816", "paypwd": 666666, "phone": "54392600993",
"email": "1542043225@qq.com", "realname2": "李四一", "idcard2": "855745919747169214", "paypwd2": "123457",
"phone2": "15527756021", "email2": "1542043226@qq.com", "sex": ""}, {"status": 400, "code": ""}])
def test_07_normal_lackemail_update(self, values, targets):
username = values["username"]
password = values["password"]
username2 = values["username2"]
password2 = values["password2"]
realname = values["realname"]
idcard = values["idcard"]
paypwd = values["paypwd"]
phone = values["phone"]
email = values["email"]
password = Common.getEncryptPassword(self.db, self.cursor, password)
password2 = Common.getEncryptPassword(self.db, self.cursor, password2)
user = (
username, realname, password, idcard,
phone,
email, paypwd, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
user = Common.getUserByUsernameAndPassword(self.db, self.cursor, username2, password2)
userDetail = [username, realname, password2, idcard, phone, email, paypwd, 1, "良好"]
Common.checkUserDetail(self.db, self.cursor, user, userDetail)
params = {}
params["username"] = username2
params["password"] = password2
login_req = requests.get(self.login_url, params=params)
cookies = login_req.cookies
cookie = ""
for k, v in cookies.items():
cookie += k + "=" + v + ";"
headers = {
'Cookie': cookie,
}
realname2 = values["realname2"]
idcard2 = values["idcard2"]
paypwd2 = values["paypwd2"]
phone2 = values["phone2"]
email2 = values["email2"]
params = {}
params["realname"] = realname2
params["idcard"] = idcard2
params["paypwd"] = paypwd2
params["phone"] = phone2
self.url = self.url + "/" + str(user[0][0])
req = requests.put(self.url, params=params, headers=headers)
req.encoding = "UTF-8"
status = req.status_code
res = req.json()
code = res["code"]
self.assertEqual(targets["status"], status)
self.assertEqual(targets["code"], code)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username":"testlisi","password":"123456","username2":"testlisi","password2":"123456","realname":"李四","idcard":"333890950506954816","paypwd":666666,"phone":"54392600993","email":"1542043225@qq.com","realname2": "李四一", "idcard2":"855745919747169214", "paypwd2":"123457","phone2":"15527756021","email2":"1542043226@qq.com","sex":""},{"status":400,"code":""}])
def test_08_normal_lackParams_update(self,values,targets):
username=values["username"]
password=values["password"]
username2 = values["username2"]
password2 = values["password2"]
realname = values["realname"]
idcard = values["idcard"]
paypwd = values["paypwd"]
phone = values["phone"]
email = values["email"]
password=Common.getEncryptPassword(self.db,self.cursor,password)
password2 =Common.getEncryptPassword(self.db,self.cursor,password2)
user = (
username, realname, password, idcard,
phone,
email, paypwd, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
user = Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2)
userDetail=[username,realname,password2,idcard,phone,email,paypwd,1,"良好"]
Common.checkUserDetail(self.db,self.cursor,user,userDetail)
params={}
params["username"]=username2
params["password"]= password2
login_req=requests.get(self.login_url,params=params)
cookies=login_req.cookies
cookie=""
for k, v in cookies.items():
cookie+=k+"="+v+";"
headers = {
'Cookie': cookie,
}
realname2 = values["realname2"]
idcard2 = values["idcard2"]
paypwd2 = values["paypwd2"]
phone2 = values["phone2"]
email2 = values["email2"]
params={}
self.url=self.url+"/"+str(user[0][0])
req=requests.put(self.url,params=params,headers=headers)
req.encoding="UTF-8"
status=req.status_code
res=req.json()
code=res["code"]
self.assertEqual(targets["status"],status)
self.assertEqual(targets["code"],code)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username": "testlisi", "password": "123456", "username2": "testlisi", "password2": "123456",
"realname": "李四", "idcard": "333890950506954816", "paypwd": 666666, "phone": "54392600993",
"email": "1542043225@qq.com", "realname2": "李四一", "idcard2": "855745919747169214", "paypwd2": "123457",
"phone2": "15527756021", "email2": "1542043226@qq.com", "sex": ""}, {"status": 400, "code": ""}])
def test_09_normal_lackParamsValue_update(self, values, targets):
username = values["username"]
password = values["password"]
username2 = values["username2"]
password2 = values["password2"]
realname = values["realname"]
idcard = values["idcard"]
paypwd = values["paypwd"]
phone = values["phone"]
email = values["email"]
password = Common.getEncryptPassword(self.db, self.cursor, password)
password2 = Common.getEncryptPassword(self.db, self.cursor, password2)
user = (
username, realname, password, idcard,
phone,
email, paypwd, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
user = Common.getUserByUsernameAndPassword(self.db, self.cursor, username2, password2)
userDetail = [username, realname, password2, idcard, phone, email, paypwd, 1, "良好"]
Common.checkUserDetail(self.db, self.cursor, user, userDetail)
params = {}
params["username"] = username2
params["password"] = password2
login_req = requests.get(self.login_url, params=params)
cookies = login_req.cookies
cookie = ""
for k, v in cookies.items():
cookie += k + "=" + v + ";"
headers = {
'Cookie': cookie,
}
realname2 = values["realname2"]
idcard2 = values["idcard2"]
paypwd2 = values["paypwd2"]
phone2 = values["phone2"]
email2 = values["email2"]
params = {}
params["realname"] = ""
params["idcard"] = ""
params["paypwd"] = ""
params["phone"] = ""
params["email"] = ""
self.url = self.url + "/" + str(user[0][0])
req = requests.put(self.url, params=params, headers=headers)
req.encoding = "UTF-8"
status = req.status_code
res = req.json()
code = res["code"]
self.assertEqual(targets["status"], status)
self.assertEqual(targets["code"], code)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username":"testlisi","password":"123456","username2":"testlisi","password2":"123456","realname":"李四","idcard":"333890950506954816","paypwd":666666,"phone":"54392600993","email":"1542043225@qq.com","realname2": "李四一", "idcard2":"855745919747169214", "paypwd2":"123457","phone2":"15527756021","email2":"1542043226@qq.com","sex":""},{"status":400,"code":""}])
def test_10_normal_SqlInject_update(self,values,targets):
username=values["username"]
password=values["password"]
username2 = values["username2"]
password2 = values["password2"]
realname = values["realname"]
idcard = values["idcard"]
paypwd = values["paypwd"]
phone = values["phone"]
email = values["email"]
password=Common.getEncryptPassword(self.db,self.cursor,password)
password2 =Common.getEncryptPassword(self.db,self.cursor,password2)
user = (
username, realname, password, idcard,
phone,
email, paypwd, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
user = Common.getUserByUsernameAndPassword(self.db,self.cursor,username2, password2)
userDetail=[username,realname,password2,idcard,phone,email,paypwd,1,"良好"]
Common.checkUserDetail(self.db,self.cursor,user,userDetail)
params={}
params["username"]=username2
params["password"]= password2
login_req=requests.get(self.login_url,params=params)
cookies=login_req.cookies
cookie=""
for k, v in cookies.items():
cookie+=k+"="+v+";"
headers = {
'Cookie': cookie,
}
realname2 = values["realname2"]
idcard2 = values["idcard2"]
paypwd2 = values["paypwd2"]
phone2 = values["phone2"]
email2 = values["email2"]
params={}
params["realname"] = realname2
params["idcard"] = idcard2
params["paypwd"] = paypwd2
params["phone"] = phone2
params["email"] = email2+"; drop table user;"
self.url=self.url+"/"+str(user[0][0])
req=requests.put(self.url,params=params,headers=headers)
req.encoding="UTF-8"
status=req.status_code
self.assertEqual(targets["status"],status)
@unittest.skipIf(test == finish, testTxt)
@unpack
@data([{"username": "testlisi", "password": "123456", "username2": "testlisi", "password2": "123456",
"realname": "李四", "idcard": "333890950506954816", "paypwd": 666666, "phone": "54392600993",
"email": "1542043225@qq.com", "realname2": "李四一", "idcard2": "855745919747169214", "paypwd2": "123457",
"phone2": "15527756021", "email2": "1542043226@qq.com", "sex": ""}, {"status": 302, "code": ""}])
def test_11_normal_overstep_update(self, values, targets):
username = values["username"]
password = values["password"]
username2 = values["username2"]
password2 = values["password2"]
realname = values["realname"]
idcard = values["idcard"]
paypwd = values["paypwd"]
phone = values["phone"]
email = values["email"]
password = Common.getEncryptPassword(self.db, self.cursor, password)
password2 = Common.getEncryptPassword(self.db, self.cursor, password2)
user = (
username, realname, password, idcard,
phone,
email, paypwd, 0, "良好")
Common.getUserIfNotExistAddUser(self.db, self.cursor, username, password, user)
user = Common.getUserByUsernameAndPassword(self.db, self.cursor, username2, password2)
userDetail = [username, realname, password2, idcard, phone, email, paypwd, 1, "良好"]
Common.checkUserDetail(self.db, self.cursor, user, userDetail)
realname2 = values["realname2"]
idcard2 = values["idcard2"]
paypwd2 = values["paypwd2"]
phone2 = values["phone2"]
email2 = values["email2"]
params = {}
params["realname"] = realname2
params["idcard"] = idcard2
params["paypwd"] = paypwd2
params["phone"] = phone2
params["email"] = email2
self.url = self.url + "/" + str(user[0][0])
req = requests.put(self.url, params=params)
req.encoding = "UTF-8"
status = req.status_code
self.assertEqual(targets["status"], status)
if __name__ == '__main__':
unittest.main()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化