def portal_verifyDraw(self, data, cookie): # 取款申請審核 cookie = cookie_process(cookie) get_path = '/WithdrawApplication' header = headers(get_path, cookie) path = '/WithdrawApplication/Apply' self.response_data = send_post_Portal_request(path, data, header[0], cookie) return self.response_data
def portal_changePassword(self, data, cookie): # 更改密碼 cookie = cookie_process(cookie) get_path = '/Account/ChangePassword' header = headers(get_path, cookie) path = '/Account/ChangePasswordSubmit' self.response_data = send_post_Portal_request(path, data, header[0], cookie) return self.response_data
def portal_missionReward(self, data, cookie, Id): cookie = cookie_process(cookie) get_path = '/MissionReward' header = headers(get_path, cookie) path = '/MissionReward/GetMissions/' + str(Id) self.response_data = send_post_Portal_request(path, data, header[0], cookie) return self.response_data
def portal_missionReward_CompleteMission(self, data, cookie): cookie = cookie_process(cookie) get_path = '/MissionReward' header = headers(get_path, cookie) path = '/MissionReward/CompleteMission' self.response_data = send_post_Portal_request(path, data, header[0], cookie) return self.response_data
def portal_GetMemberDiscountDetail(self, data, cookie): # 前台領取時返詳細 cookie = cookie_process(cookie) get_path = '/' header = headers(get_path, cookie) path = '/AnyTimeDiscount/GetMemberDiscountDetail' self.response_data = send_post_Portal_request(path, data, header[0], cookie) return self.response_data
def portal_NewLuckyWheel_startRaffle(self, data, cookie): # 時來運轉 - 開始旋轉 cookie = cookie_process(cookie) get_path = '/NewLuckyWheel' header = headers(get_path, cookie) path = '/NewLuckyWheel/StartRaffle' self.response_data = send_post_Portal_request(path, data, header[0], cookie) return self.response_data
def portal_ReceiveMemberAnyTimeDiscount(self, data, cookie): # 前台領取時返 cookie = cookie_process(cookie) get_path = '/' header = headers(get_path, cookie) path = '/AnyTimeDiscount/ReceiveMemberAnyTimeDiscount' self.response_data = send_post_Portal_request(path, data, header[0], cookie) return self.response_data
def portal_Get_RedEnvelopeList(self, data, cookie): cookie = cookie_process(cookie) get_path = '/' header = headers(get_path, cookie) path = '/RedEnvelope/GetRedEnvelopList' self.response_data = send_post_Portal_request(path, data, header[0], cookie) return self.response_data
def portal_RedEnvelope_Recevied(self, data, cookie): # 前台接收紅包 cookie = cookie_process(cookie) get_path = '/' header = headers(get_path, cookie) path = '/RedEnvelope/Received' self.response_data = send_post_Portal_request(path, data, header[0], cookie) return self.response_data
def portal_OnlineDeposit_Send_V2(self, data, cookie): cookie = cookie_process(cookie) get_path = '/OnlineDeposit/Payment?type=General' header = headers(get_path, cookie) path = '/OnlineDeposit/Send_V2' self.response_data = send_post_Portal_request(path, data, header[0], cookie) return self.response_data
def portal_CompanyDeposit(self, data, cookie): cookie = cookie_process(cookie) get_path = '/CompanyDeposit/NewIndex' header = headers(get_path, cookie) path = '/CompanyDeposit/Apply' self.response_data = send_post_Portal_request(path, data, header[0], cookie) return self.response_data
def portal_siteMail_error(self, data, cookie): cookie = cookie_process(cookie) get_path = '/SiteMail' header = headers(get_path, cookie) path = '/SiteMail/SendMail' self.response_data = send_error_post_Portal_request( path, data, header[0], cookie) return self.response_data
def portal_setBankAccount(self, data, cookie): cookie = cookie_process(cookie) get_path = '/WithdrawApplication' header = headers(get_path, cookie) path = '/WithdrawApplication/UpdateBankAccount' self.response_data = send_post_Portal_request(path, data, header[0], cookie) return self.response_data
def portal_LuckyWheel_inputSerialNumber(self, data, cookie): # 幸運輪盤 - 輸入抽獎序號 cookie = cookie_process(cookie) get_path = '/LuckyWheel' header = headers(get_path, cookie) path = '/LuckyWheel/InputSerialNumber' self.response_data = send_post_Portal_request(path, data, header[0], cookie) return self.response_data
def test_oldCookie(self): """驗證-登入成功之後更改成舊token是否被登出""" self.portal = Portal_test() self.portal_api = Portal_api() login = self.portal.login( self.config.test_Member_config(), self.config.test_Password_config()) # 登入後cookie # print(type(login)) get_cookie = cookie_process(login) cookie_update = RequestsCookieJar() cookie_update.set('protalnew', get_cookie['portalnew']) # 加入舊Token get_cookie.update(cookie_update) get_cookie.pop('portalnew') # 刪除新的Token get_cookie = RequestsCookieJar() # print(type(get_cookie)) data = {"Subject": "dfgdfg", "MailBody": "<p>dfgdfgdfgfd</p>\n"} response_data = self.portal_api.portal_siteMail_error(data, get_cookie) validate = '302' self.assertEqual(validate, response_data[0])