Example #1
0
 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()
Example #2
0
 def test07_list_all(self):
     headers = {'Content-Type': 'application/json'}
     data = {"action": "signin", "username": '******', "password": '******'}
     GetSession.get_session().post(api.login_url,
                                   json=data,
                                   headers=headers)
     params = {
         'action': 'listbypage',
         'pagesize': 10,
         'pagenum': 1,
         'keywords': ''
     }
     re = GetSession.get_session().get(api.work_flow, params=params)
     assert re.status_code == 200
     assert re.json()['ret'] == 0
     assert re.json()['total'] == 4
Example #3
0
 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)
Example #4
0
    def test09_check_step(self):
        result = (
            '{"ret": 0, "data": [{"name": "毕业设计标题", "type": "text", "value": '
            '"阿水电费水电费水电费ds"}, {"name": "主题描述", "type": "textarea", "value": '
            '"阿萨德但是但是是的是第三方第三方是否但是"}]}')

        params = {'action': 'getstepactiondata', 'step_id': 12}
        re = GetSession.get_session().get(api.work_flow, params=params)
        assert re.status_code == 200
        assert re.text == result
Example #5
0
 def test05_submit(self):
     headers = {'Content-Type': 'application/json'}
     data = {
         "action":
         "stepaction",
         "key":
         "submit_design",
         "wf_id":
         self.wk_id,
         "submitdata": [{
             "name": "毕业设计内容",
             "type": "richtext",
             "value": "898494949849494984949444498498449"
         }]
     }
     re1 = GetSession.get_session().post(url=api.work_flow,
                                         json=data,
                                         headers=headers)
     assert re1.json()['ret'] == 0
Example #6
0
 def test03_modify(self):
     headers = {'Content-Type': 'application/json'}
     data = {
         "action":
         "stepaction",
         "key":
         "modify_topic",
         "wf_id":
         self.wk_id,
         "submitdata": [{
             "name": "毕业设计标题",
             "type": "text",
             "value": "test01的毕业设计2"
         }, {
             "name": "主题描述",
             "type": "richtext",
             "value": "这是我的毕业设计11111113"
         }]
     }
     re1 = GetSession.get_session().post(url=api.work_flow,
                                         json=data,
                                         headers=headers)
     assert re1.json()['ret'] == 0
Example #7
0
 def Api_logout_post(self, url):
     headers = {'Content-Type': 'application/json'}
     data = {"action": "signout"}
     session = GetSession.get_session()
     return session.post(url, json=data, headers=headers)
Example #8
0
 def test08_get_one(self):
     headers = {'Content-Type': 'application/json'}
     params = {'action': 'getone', 'wf_id': self.wk_id, 'keywords': ''}
     re = GetSession.get_session().get(api.work_flow, params=params)
     assert re.status_code == 200
     assert re.json()['ret'] == 0