def create_transaction_deal(self): self.s = requests.session() # 登记出售房源并获取房源id self.sale_caseid, self.sale_no = HouseManage.HouseManage( ).get_saleHouse_caseNo() # 登记求购客源并获取id self.caseid, self.header = CustomerManage.CustomerManage( ).create_BuyCustomer() # 获取出售中未使用的合同编号 self.codeNo, self.headers = CustomerManage.CustomerManage( ).get_buyMatchNotAllocatedDealCode() # 读取出excel中的测试数据 case = readexcel.ExcelUtil(CUSTOMER_MANAGE_EXCEL_PATH, sheetName="客源管理-求购-新增合同").dict_data()[1] print(case) a = json.loads(case["body"]) case["headers"] = self.headers a["custId"] = self.caseid a["dealCustomerId"] = self.caseid a["signDate"] = get_date.GetDate().get_today_str_data() a["contractNo"] = self.codeNo a["dealHouseId"] = self.sale_caseid a["dealHouseNo"] = self.sale_no b = json.dumps(a) case.update({"body": b}) res = base_api.send_requests(self.s, case) res_text = json.loads(res["text"]) return res_text["data"][ "dealId"], self.headers, self.sale_caseid, self.caseid
def setUpClass(cls): # 保持登录状态 cls.s = requests.session() #创建求购中按照面积来排序的房源 cls.Lower_caseid = CustomerManage.CustomerManage( ).create_BuyCustomer_LowerArea() cls.High_caseid, cls.headers = CustomerManage.CustomerManage( ).create_BuyCustomer_HighArea()
def setUpClass(cls): # 保持登录状态 cls.s = requests.session() #创建求租中按照价格来排序的房源 cls.Lower_caseid = CustomerManage.CustomerManage( ).create_RentCustomer_LowerPrice() cls.High_caseid, cls.headers = CustomerManage.CustomerManage( ).create_RentCustomer_HighPrice()
def tearDownClass(cls): lowerPrice_code = CustomerManage.CustomerManage().delete_buyCustomer( cls.LowerPrice_caseid) highPrice_code = CustomerManage.CustomerManage().delete_buyCustomer( cls.HighPrice_caseid) if lowerPrice_code == 200 and highPrice_code == 200: print("房源删除成功") else: print("房源删除失败")
def tearDownClass(cls): lower_coed = CustomerManage.CustomerManage().delete_rentCustomer( cls.Lower_caseid) high_code = CustomerManage.CustomerManage().delete_rentCustomer( cls.High_caseid) if lower_coed == 200 and high_code == 200: print("房源删除成功") else: print("房源删除失败")
def setUp(self): # 保持会话状态 self.s = requests.session() #登记出租房源并获取房源id self.lease_caseid, self.lease_header = HouseManage.HouseManage( ).create_houseLease() #登记求租客源并获取客源id self.caseid, self.header = CustomerManage.CustomerManage( ).create_RentCustomer() # 获取出租中未使用的合同编号 self.codeNo, self.headers = CustomerManage.CustomerManage( ).get_rentMatchNotAllocatedDealCode()
def tearDownClass(cls): sale_code = HouseManage.HouseManage().delete_houseSale(cls.caseid_sale) lease_code = HouseManage.HouseManage().delete_leaseHouse( cls.caseid_lease) buy_code = CustomerManage.CustomerManage().delete_buyCustomer( cls.caseid_buy) rent_code = CustomerManage.CustomerManage().delete_rentCustomer( cls.caseid_rent) if sale_code == 200 and lease_code == 200 and buy_code == 200 and rent_code == 200: print("加密房客源删除成功") else: print("加密房客源删除失败")
def setUp(self): # 保持会话状态 self.s = requests.session() #登记出售房源并获取房源id self.sale_caseid, self.sale_header = HouseManage.HouseManage( ).create_houseSale() #登记求购客源并获取id self.caseid, self.header = CustomerManage.CustomerManage( ).create_BuyCustomer() # 获取出售中未使用的合同编号 self.codeNo, self.headers = CustomerManage.CustomerManage( ).get_buyMatchNotAllocatedDealCode()
def setUpClass(cls): # 保持会话 cls.s = requests.session() #创建加密房客源 cls.caseid_sale = HouseManage.HouseManage().add_pwd_houseSale() cls.caseid_lease = HouseManage.HouseManage().add_pwd_houseLease() cls.caseid_buy = CustomerManage.CustomerManage().add_pwd_buyCustomer() cls.caseid_rent = CustomerManage.CustomerManage().add_pwd_rentCustomer( ) header = add_clientkey_to_headers.get_clientkey() cls.header = header
def tearDown(self): if self.data == "1": # 撤销初审 code = TransactionDeal.TransactionDeal().cancel_contract_status( self.deal_id, "5") if code == 200: print("撤销初审成功") elif self.data == "2": # 撤销复审 codes = TransactionDeal.TransactionDeal().cancel_contract_status( self.deal_id, "6") if codes == 200: print("撤销复审成功") # 合同作废 code_data = TransactionDeal.TransactionDeal().delete_contract( self.deal_id) if code_data == 200: print("合同作废成功") # 删除求购的客源 if self.custor_id > 0: buyCustomer_errcode = CustomerManage.CustomerManage( ).delete_buyCustomer(self.custor_id) if buyCustomer_errcode == 200: print("登记求购的客源已成功删除") else: print("登记求购客源删除失败") # 删除登记的出售房源 if self.sale_id > 0: huoseSale_errcode = HouseManage.HouseManage().delete_houseSale( self.sale_id) if huoseSale_errcode == 200: print("登记出售房源已成功删除") else: print("登记出售房源删除失败")
def tearDown(self): if self.caseid > 0: buyCustomer_errcode = CustomerManage.CustomerManage( ).delete_rentCustomer(self.caseid) if buyCustomer_errcode == 200: print("登记求租的客源已成功删除") else: print("登记求租客源删除失败") # 删除登记的出租房源 if self.lease_caseid > 0: huoseSale_errcode = HouseManage.HouseManage().delete_leaseHouse( self.lease_caseid) if huoseSale_errcode == 200: print("登记出租房源已成功删除") else: print("登记出租房源删除失败")
def tearDown(self): if self.caseid > 0: buyCustomer_errcode = CustomerManage.CustomerManage( ).delete_buyCustomer(self.caseid) if buyCustomer_errcode == 200: print("登记求购的客源已成功删除") else: print("登记求购客源删除失败") # 删除登记的出售房源 if self.sale_caseid > 0: huoseSale_errcode = HouseManage.HouseManage().delete_houseSale( self.sale_caseid) if huoseSale_errcode == 200: print("登记出售房源已成功删除") else: print("登记出售房源删除失败")