def teardown_class(cls): headers = {'Content-Type': 'application/json'} data = {"action": "signout"} GetSession.get_session().post(api.logout_url, json=data, headers=headers) GetSession.get_session2().post(api.login_url, json=data, headers=headers) GetSession().clear_session() GetSession().clear_session2()
def setup_class(cls): run_sql('delete from cimp_wf_design where creator_id = 12 ') run_sql( 'delete from cimp_wf_design_step where operator_id = 12 or operator_id = 13' ) headers = {'Content-Type': 'application/json'} data = {"action": "signin", "username": '******', "password": '******'} data2 = { "action": "signin", "username": '******', "password": '******' } GetSession.get_session().post(api.login_url, json=data, headers=headers) GetSession.get_session2().post(api.login_url, json=data2, headers=headers)
def test02_reject(self): headers = {'Content-Type': 'application/json'} data = { "action": "stepaction", "key": "reject_topic", "wf_id": self.wk_id, "submitdata": [{ "name": "驳回原因", "type": "textarea", "value": "asdfsadfasfasfdf" }] } re2 = GetSession.get_session2().post(url=api.work_flow, json=data, headers=headers) assert re2.json()['ret'] == 0
def test04_approve(self): headers = {'Content-Type': 'application/json'} data = { "action": "stepaction", "key": "approve_topic", "wf_id": self.wk_id, "submitdata": [{ "name": "备注", "type": "richtext", "value": "222222222222222222222222222222" }] } re2 = GetSession.get_session2().post(url=api.work_flow, json=data, headers=headers) assert re2.json()['ret'] == 0
def test06_score(self): headers = {'Content-Type': 'application/json'} data = { "action": "stepaction", "key": "score_design", "wf_id": self.wk_id, "submitdata": [{ "name": "得分", "type": "int", "value": 100 }, { "name": "备注", "type": "richtext", "value": "8949498191919191981981" }] } re2 = GetSession.get_session2().post(url=api.work_flow, json=data, headers=headers) assert re2.json()['ret'] == 0