def test_login_wrong_ID(self):
     '''输入错误的账号'''
     data = {"mobilephone": "185932980", "pwd": "123456"}
     res = HttpRequest().http_request(self.login_url, data, 'get')
     try:
         self.assertEqual('20111', res.json()['code'])
     except AssertionError as  e:
         print("test_login_wrong_ID's error is {}".format(e))
 def test_recharge_negative(self):
     '''充值为负数'''
     data = {"mobilephone": "18593298080", "amount": "-1100"}
     res = HttpRequest().http_request(self.recharge_url, data, 'post', cookie=self.cookies)
     try:
         self.assertEqual('20117', res.json()['code'])
     except AssertionError as e:
         print("test_recharge_noMoney's error is {}".format(e))
         raise e
 def test_recharge_noID(self):
     '''不输入账号'''
     data = {"mobilephone": "", "amount": "1100"}
     res = HttpRequest().http_request(self.recharge_url, data, 'post', cookie=self.cookies)
     try:
         self.assertEqual('10001', res.json()['code'])
     except AssertionError as e:
         print("test_recharge_normal's error is {}".format(e))
         raise e
 def test_login_noID(self):
     '''不输入账号'''
     data = {"mobilephone": "", "pwd": "123456"}
     res = HttpRequest().http_request(self.login_url, data, 'get')
     try:
         self.assertEqual('20103', res.json()['code'])
     except AssertionError as  e:
         print("test_login_noID's error is {}".format(e))
         raise e
 def test_login_normal(self):
     '''正常登录'''
     data = {"mobilephone": "18593298080", "pwd": "123456"}
     res = HttpRequest().http_request(self.login_url, data, 'get')
     if res.cookies:
         setattr(GetDate,'Cookie')
     try:
         self.assertEqual('10001',res.json()['code'])
     except AssertionError as  e:
         print("test_login_normal's error is {}".format(e))
         raise e