def test_two_debits(sdd): payment1 = { "name": "Test von Testenstein", "IBAN": "NL50BANK1234567890", "BIC": "BANKNL2A", "amount": 1012, "type": "FRST", "collection_date": datetime.date.today(), "mandate_id": "1234", "mandate_date": datetime.date.today(), "description": "Test transaction1" } payment2 = { "name": "Test du Test", "IBAN": "NL50BANK1234567890", "BIC": "BANKNL2A", "amount": 5000, "type": "RCUR", "collection_date": datetime.date.today(), "mandate_id": "1234", "mandate_date": datetime.date.today(), "description": "Test transaction2" } sdd.add_payment(payment1) sdd.add_payment(payment2) xmlout = sdd.export() xmlpretty = validate_xml(xmlout, "pain.008.003.02") assert clean_ids(xmlpretty.strip()) == clean_ids(SAMPLE_RESULT.strip())
def test_two_debits(sdd): payment1 = { "name": "Test & Co.", "IBAN": "NL50BANK1234567890", "BIC": "BANKNL2A", "amount": 1012, "type": "FRST", "collection_date": datetime.date.today(), "mandate_id": "1234", "mandate_date": datetime.date.today(), "description": "Test transaction1", "endtoend_id": "ebd75e7e649375d91b33dc11ae44c0e1" } payment2 = { "name": "Test du Test", "IBAN": "NL50BANK1234567890", "BIC": "BANKNL2A", "amount": 5000, "type": "RCUR", "collection_date": datetime.date.today(), "mandate_id": "1234", "mandate_date": datetime.date.today(), "description": u"Testgrüße <html>", "endtoend_id": "af755a40cb692551ed9f9d55f7179525" } sdd.add_payment(payment1) sdd.add_payment(payment2) xmlout = sdd.export() xmlpretty = validate_xml(xmlout, "pain.008.003.02") assert clean_ids(xmlpretty.strip()) == clean_ids(SAMPLE_RESULT.strip())
def test_two_debits(strf): payment1 = { "endtoend_id": "ebd75e7e649375d91b33dc11ae44c0e1", "name": "Test von Testenstein", "IBAN": "NL50BANK1234567890", "BIC": "BANKNL2A", "amount": 1012, "execution_date": datetime.date.today(), "description": "Test transaction1" } payment2 = { "name": "Test von Testenstein", "IBAN": "NL50BANK1234567890", "BIC": "BANKNL2A", "amount": 1012, "execution_date": datetime.date.today(), "description": "Test transaction1", "endtoend_id": "af755a40cb692551ed9f9d55f7179525" } strf.add_payment(payment1) strf.add_payment(payment2) xmlout = strf.export() xmlpretty = validate_xml(xmlout, "pain.001.001.03") print(xmlpretty.decode()) assert clean_ids(xmlpretty.strip()) == clean_ids(SAMPLE_RESULT.strip())
def test_two_transfers(strf): payment1 = { "name": "Test von Testenstein", "IBAN": "NL50BANK1234567890", "amount": 1012, "execution_date": datetime.date.today(), "description": "Test transaction1" } payment2 = { "name": "Test du Test", "IBAN": "NL50BANK1234567890", "amount": 5000, "execution_date": datetime.date.today(), "description": "Test transaction2" } strf.add_payment(payment1) strf.add_payment(payment2) xmlout = strf.export() xmlpretty = validate_xml(xmlout, "pain.001.001.03") assert clean_ids(xmlpretty.strip()).decode() == clean_ids(SAMPLE_RESULT.strip()).decode()