def __init__(self, response, debug=False): # Bank of America (California) seems to be putting out bad Content-type # headers on manual OFX download. I'm special-casing this out since # B of A is such a large bank. # REVIEW: Check later to see if this is still needed, espcially once # B of A is mechanized. # REVIEW: Checked. Still needed. Feh! if not isinstance(response, str): response = response.decode('utf-8') self.raw_response = response self.raw_response = self.raw_response.replace( 'Content- type:application/ofx', "") # Good god, another one. Regex? self.raw_response = self.raw_response.replace( 'Content-Type: application/x-ofx', "") # I'm seeing this a lot, so here's an ugly workaround. I wonder why multiple # FIs are causing it, though. self.raw_response = self.raw_response.replace( '****OFX download terminated due to exception: Null or zero length FITID****', '') parser = Parser(debug) self.parse_dict = parser.parse(self.raw_response) self.ofx = self.parse_dict["body"]["OFX"][0].asDict()
def setUp(self): parser = Parser() checking_stmt = get_checking_stmt() creditcard_stmt = get_creditcard_stmt() blank_memo_stmt = get_blank_memo_stmt() self.checkparse = parser.parse(checking_stmt) self.creditcardparse = parser.parse(creditcard_stmt) self.blank_memoparse = parser.parse(blank_memo_stmt)
def setUp(self): self.request = Request() self.institution = Institution(ofx_org="fi_name", ofx_fid="1000") self.account = Account(acct_number="00112233", aba_number="12345678", acct_type="Checking", institution=self.institution) self.username = "******" self.password = "******" self.parser = Parser()