예제 #1
0
 def create_acount(self, package_type):
     """创建基础免费账号"""
     phone_number = cp()
     sub_firm_id = 169783
     name = "test" + str(phone_number[5:])
     resp = self.client.app_users_sub_create(mobile=phone_number, name=name, package_type=package_type, pl_style=0,
                                             sub_firm_id=sub_firm_id)
     return resp.data
예제 #2
0
 def test_app_users_sub_create(self):
     """创建基础免费账号"""
     phone_number = cp()
     sub_firm_id = 169783
     name = "test" + str(sub_firm_id)
     resp = self.client.app_users_sub_create(mobile=phone_number, name=name, package_type=1, pl_style=0,
                                             sub_firm_id=sub_firm_id)
     self.assertEqual(10000, resp.code)
예제 #3
0
 def test_app_users_sub_create_base_out(self):
     """创建基础免费账号"""
     phone_number = cp()
     sub_firm_id = 370303
     name = "test" + str(sub_firm_id)
     resp1 = self.client.app_users_sub_create(mobile=phone_number, name=name, package_type=2, pl_style=0,
                                              sub_firm_id=sub_firm_id)
     self.assertEqual(5001, resp1.code)
     self.assertIn("公司没有有效正式订阅", resp1.message)
예제 #4
0
 def test_app_users_sub_create_name_none(self):
     """创建基础免费账号"""
     phone_number = cp()
     sub_firm_id = 169783
     name = "test" + str(sub_firm_id)
     resp = self.client.app_users_sub_create(mobile=phone_number, package_type=1, pl_style=0,
                                             sub_firm_id=sub_firm_id)
     self.assertEqual(5001, resp.code)
     self.assertIn("使用人姓名不能为空", resp.message)
예제 #5
0
 def test_app_users_sub_create_mobile_error(self):
     """创建基础免费账号"""
     phone_number = cp()
     sub_firm_id = 169783
     name = "test" + str(sub_firm_id)
     resp = self.client.app_users_sub_create(mobile="....", name=name, package_type=1, pl_style=0,
                                             sub_firm_id=sub_firm_id)
     self.assertEqual(5003, resp.code)
     self.assertIn("手机号格式错误!", resp.message)
예제 #6
0
 def test_app_users_sub_create_sub_exist(self):
     """创建基础免费账号,手机号为其他公司名下联系人手机号"""
     phone_number = cp()
     sub_firm_id = 169783
     name = "test" + str(sub_firm_id)
     resp = self.client.app_users_sub_create(mobile=phone_number, name=name, package_type=1, pl_style=0,
                                             sub_firm_id=sub_firm_id)
     resp2 = self.client.app_users_sub_create(mobile=phone_number, name=name, package_type=1, pl_style=0,
                                              sub_firm_id="52495")
     self.assertEqual(5001, resp2.code)