Example #1
0
    def setUpClass(cls):
        cls.s = requests.session()
        housemanage = HouseManage()
        cls.caseid, cls.header = housemanage.create_houseSale()
        #房堪
        url = "http://hft.myfun7.com/houseWeb/houseCust/createTrackInfo"
        data = {
            "caseId": cls.caseid,
            "caseType": "1",
            "coreSellPoint": "好",
            "trackContent": "核心卖点:好",
            "trackType": "3"
        }

        requests.post(url, json=data, headers=cls.header)

        #上传5张房勘图片
        url = "http://hft.myfun7.com/houseWeb/housePhoto/createMultipleHousePhotos"
        data = {
            "caseId": cls.caseid,
            "caseType": "1",
            "photoAddr":
            "oss/online/tmp/2020/04/23/c19456a8739042fda065b2d7fbe69049.jpg,oss/online/tmp/2020/04/23/6cf18050393d4fcbad3b2101fe9bc4d6.jpg,oss/online/tmp/2020/04/23/f075f9f72c43464fa0f78cb7e8d08b22.jpg,oss/online/tmp/2020/04/23/cb82a2c0834e403cb2e419aed3d399b5.jpg,oss/online/tmp/2020/04/23/62ab76105de54c94b337b583137da9e8.jpg",
            "photoSource": "1",
            "photoType": "0"
        }
        res = requests.post(url, json=data, headers=cls.header)
        print("上传房堪图片成功")
        print(res.json())

        #查看房源笋盘剩余推送条数
        url = "http://hft.myfun7.com/houseWeb/houseCust/getFocusPlateCount"
        data = {"caseId": cls.caseid, "caseType": "1"}
        res = requests.post(url, json=data, headers=cls.header)
        print(res.json())
Example #2
0
 def tearDownClass(cls):
     #删除登记的房源
     code_a = HouseManage().delete_houseSale(cls.caseid_a)
     code_b = HouseManage().delete_houseSale(cls.caseid_b)
     code_c = HouseManage().delete_houseSale(cls.caseid_c)
     code_d = HouseManage().delete_houseSale(cls.caseid_d)
     code_e = HouseManage().delete_houseSale(cls.caseid_e)
     if code_a == 200 and code_b == 200 and code_c == 200 and code_d == 200 and code_e == 200:
         print("房源删除成功")
     else:
         print("房源删除失败")
    def setUp(self):
        self.s = requests.session()
        # 创建出售房源
        self.caseid, self.header = HouseManage().create_houseSale()

        # 上传3张图片
        url = "http://hft.myfun7.com/houseWeb/housePhoto/createMultipleHousePhotos"
        data = {
            "caseId":
            self.caseid,
            "caseType":
            "1",
            "photoAddr":
            addimage.AddImg().sendImg(jpgpath) + "," +
            addimage.AddImg().sendImg(jpgpath) + "," +
            addimage.AddImg().sendImg(jpgpath),
            "photoSource":
            "1",
            "photoType":
            "0"
        }
        self.headers = add_clientkey_to_headers.get_clientkey(
        )  # 重新获取clientkey
        res = requests.post(url, json=data, headers=self.headers)
        print(res.json())
    def tearDown(self):
        # 删除视频
        if "videoId" in self.res_text.keys():
            code = HouseManage().delete_saleHouse_video(
                self.headers, self.caseid, self.res_text["videoId"])
            if code == 200:
                print("视频成功删除")
            else:
                print("视频删除失败")

        #删除房源
        if self.caseid > 0:
            # print(cls.caseid)
            url = "http://hft.myfun7.com/houseWeb/houseCust/createTrackInfo"
            data = {
                "caseId": self.caseid,
                "caseType": "1",  # 1 代表出售房源
                "isSaleLease": "0",  # 是否是租售房源,1=是,0=否  默认是0
                "trackContent": "content",
                "trackType": "30"  # 30 代表删除房源
            }
            r = requests.post(url=url, json=data, headers=self.headers)
            if r.json()["errCode"] == 200:
                print("登记出售房源已成功删除")
            else:
                print("登记的房源删除失败的原因:%s", (r.json()["errMsg"]))
        else:
            print("登记出售房源失败,没有出售的房源可删除")
Example #5
0
 def setUpClass(cls):
     # 保持会话状态
     cls.s = requests.session()
     #创建一个出租中的房源,并获取到caseid
     cls.leaseHouse_caseid, cls.leaseHeaders = HouseManage(
     ).create_houseLease()
     #创建一个求租客源,获取到caseid,用于后续创建跟进
     cls.caseid, cls.headers = CustomerManage().create_RentCustomer()
Example #6
0
    def setUpClass(cls):
        # 如果有登录的话,在这里先登录
        cls.s = requests.session()
        #创建一个出售中的房源,并获取到caseid
        cls.saleHouse_caseid, cls.saleHeaders = HouseManage().create_houseSale(
        )

        #创建一个求购客源,获取到caseid,用于后续创建跟进
        cls.caseid, cls.headers = CustomerManage().create_BuyCustomer()
    def setUp(self):
        # 如果有登录的话,就在这里先登录了
        self.s = requests.session()

        #获取上传视频的url
        login_get_clientkey.login()
        self.video_url = addimage.AddImg().sendVide(VIDEO_PATH)

        #创建出售的房源
        self.caseid, self.headers = HouseManage().create_houseSale()
Example #8
0
 def setUpClass(cls):
     cls.s = requests.session()
     #创建5个出售房源
     lst = []
     for i in range(0, 5):
         caseid, headers = HouseManage().create_houseSale()
         a = caseid
         lst.append(a)
         print(lst)
     #分别将创建的5个房源写成封盘、预定、暂缓、内成交以及外成交状态
     cls.caseid_a = HouseStatus().create_fengPan(lst[0])
     cls.caseid_b = HouseStatus().create_yuDing(lst[1])
     cls.caseid_c = HouseStatus().create_zanHuan(lst[2])
     cls.caseid_d = HouseStatus().create_neiChengJiao(lst[3])
     cls.caseid_e = HouseStatus().create_waiChengJiao(lst[4])
     sleep(5)
     return lst
Example #9
0
 def setUp(self):
     # 如果有登录的话,就在这里先登录了
     self.s = requests.session()
     self.caseid, self.headers = HouseManage().create_houseSale()