import time import datetime import json import re from Common import encryption from Common import Reids from Common import DB from Common import Read_config from Common.BaseCase import BaseCase #数据准备 cf = Read_config.ReadConfig() db = DB.DB_enterprise() re = Reids.Redis() logintoken = cf.get_userdatainfo('logintoken') worksurfaceid = cf.get_project('worksurfaceid') addemployeeid2 = cf.get_employeeinfo('addemployeeid2') addemployeeid = cf.get_employeeinfo('addemployeeid') daytime = time.strftime('%Y-%m-%d', time.localtime(time.time())) utctime = datetime.datetime.utcnow().isoformat() class test_project_team(BaseCase): def test_add_teamemployee(self): #添加项目人员 cf = Read_config.ReadConfig() projectid = cf.get_project('projectid') data_value = addemployeeid2 + ',' + projectid data = self.get_case_data("test_add_teamemployee") check = self.send_request(data, headersvariable=logintoken, datavariable=data_value)
# # # if __name__ == '__main__': # a=test_user_login() # a.test_usre_login_2_login() # check='{"code":200,"msg":"success","data":{"projectId":25,"projectCompanyId":39,"joinSuccess":0,"joinFail":0}}' # request = json.loads(check) # print(request) # projectCompanyId=request.get('data').get('projectCompanyId') # print(projectCompanyId) # td = datetime.timedelta(hours=+10) # print(td) # print(datetime.datetime.utcnow().isoformat()) # print((datetime.datetime.utcnow() + td).isoformat()) uuid = encryption.Encryption() redis = Reids.Redis() key = uuid.get_uuid() code = [ "com.dh4cloud.versatile.util.ImageCodeGenUtil$ImageCode", { "code": "RN69", "base64": "iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAIAAAD/gAIDAAABY0lEQVR42u3YQWrDMBAFUC/aRXqD7nuBXqD3yB1CIOT+tIuCEZIsKzTFGvt9tEikQOBhjUaevqU7EwJYY2CdXj+rI/vZy+V9HktL6eTH5S0dO8fKvB7CyqSWvL6mczoiYbUnU6zMK5us6pRYmdQmZKNgtf+01Nkn1vy5ulTdgI3HanVydKxq2SqxZq8erMwrPFZngU+/trHKYn9orPJBW6ruS1hlzYq6Ddv9wV+wGqdhMKzVAl89Hx/FGqF7eDLWPN9uGhp9Vn8fH7V1KOdX2/cSa7V72La6/wvW71I/VufdcPP2Pdhbh3h3Q69oBBYsWLBgwRJYsGDBggVLYMGCBQsWLIEFCxYsWLAEFixYsGDBEliwYMGCBUtgwYIFCxYsgQULFixYsAQWLFiwYMESWLBgwYIFa8Rc7zdYsI7hBQvWMU/DobxgwYIFK5IXLFhHvkgP4gVrd1i2ISxYAgsWLFjx8gO9LC2JJLtcmAAAAABJRU5ErkJggg==" } ] print(code[1].get("code"), type(code[1]))