示例#1
0
 def test_add_address_failed_city_mismatch(self):
     res = Action().error_para("city")
     self.assertEqual(res['code'], 400)
     self.assertEqual(res['message'], "请求参数不正确")
示例#2
0
 def test_add_address_failed_area_lack(self):
     res = Action().lack_para("area")
     self.assertEqual(res['code'], 400)
     # self.assertEqual(res['message'], "area参数不存在")
     self.assertEqual(res['message'], "may not be null")
示例#3
0
 def test_add_address_success_provincecity(self):
     res = Action().para("张三", "12345678901", "复旦大学", "上海市", "上海市", "黄埔区")
     self.assertEqual(res['code'], 400)
     self.assertEqual(res['message'], "成功")
示例#4
0
 def test_add_address_success(self):
     res = Action().default_para()
     self.assertEqual(res['code'], 200)
示例#5
0
 def test_add_address_failed_province_lack(self):
     res = Action().lack_para("province")
     self.assertEqual(res['code'], 400)
     # self.assertEqual(res['message'], "province参数不存在")
     self.assertEqual(res['message'], "may not be null")
示例#6
0
 def test_add_address_failed_area_type(self):
     res = Action().type_para("area", 571)
     self.assertEqual(res['code'], 400)
     self.assertEqual(res['message'], "area参数类型不正确")
示例#7
0
 def test_add_address_failed_name_lack(self):
     res = Action().lack_para("receiverName")
     self.assertEqual(res['code'], 400)
     self.assertEqual(res['message'], "receiverName参数不存在")
示例#8
0
 def test_add_address_failed_detail_type(self):
     res = Action().type_para("addressDetail", 123)
     self.assertEqual(res['code'], 400)
     self.assertEqual(res['message'], "addressDetail参数类型不正确")
示例#9
0
 def test_add_address_failed_province_type(self):
     res = Action().type_para("province", 571)
     self.assertEqual(res['code'], 400)
     self.assertEqual(res['message'], "province参数类型不正确")
示例#10
0
 def test_add_address_failed_phone_type_01(self):
     res = Action().type_para("cellPhone", 12345678901)
     self.assertEqual(res['code'], 400)
     self.assertEqual(res['message'], "cellPhone参数类型不正确")
示例#11
0
 def test_add_address_failed_phone_type_02(self):
     res = Action().type_para("cellPhone", None)
     self.assertEqual(res['code'], 400)
     # self.assertEqual(res['message'], "请求参数不正确")
     self.assertEqual(res['message'], "may not be null")
示例#12
0
 def test_add_address_failed_name_type_02(self):
     res = Action().type_para("receiverName", "")
     self.assertEqual(res['code'], 400)
     self.assertEqual(res['message'], "请求参数不正确")
示例#13
0
 def test_add_address_failed_logout(self):
     res = Action().logout_add()
     self.assertEqual(res['code'], 400)
     self.assertEqual(res['message'], "未登录")
示例#14
0
 def test_add_address_failed_exce(self):
     res = Action().exce_address()
     self.assertEqual(res['code'], 400)
     self.assertEqual(res['message'], "最多只能添加6个地址")
示例#15
0
 def test_add_address_failed_same_address(self):
     res = Action().default_para()
     self.assertEqual(res['code'], 400)
     self.assertEqual(res['message'], "收货地址已存在")
示例#16
0
 def test_add_address_failed_cityAndareaAndprovince_mismatch(self):
     res = Action().error_para("city", "area", "province")
     self.assertEqual(res['code'], 400)
     self.assertEqual(res['message'], "请求参数不正确")