Ejemplo n.º 1
0
 def test0004(self):
     """this a test for admin status
     """
     Initialization.disconnect(self)
     self.token, self.ip_addr = Initialization.start_session(self)
     Initialization.register(self, 'testadmin', 'Test666', '11011011011')
     Initialization.login(self, 'testadmin', 'Test666')
     Initialization.promote_user(self, 4)
     code_id = ProgramHelper.get_program_by_name('在野代码').get('id')
     source = 0
     target = 1
     response = self.client.post(
         '/program/admin/status', {
             'token': self.token,
             'code_id': code_id,
             'source': source,
             'target': target
         })
     data = analyse_response(response)
     self.assertEqual(data.get('msg'), 'Status Changed Successful')
Ejemplo n.º 2
0
 def tearDown(self):
     """This will be called after test
     """
     Initialization.disconnect(self)