add test for no-duplicates on bank import

This commit is contained in:
Andreas Madsack 2018-01-13 14:03:47 +01:00
parent 3005cc1ae9
commit f179ac2ccd

View File

@ -25,6 +25,17 @@ def bank_transaction_csv_file():
@pytest.mark.django_db
def test_bank_import(bank_transaction_csv_file):
assert bank_transaction_csv_file.transactions.count() == 0
process_bank_csv(bank_transaction_csv_file)
process_bank_csv(bank_transaction_csv_file, None)
bank_transaction_csv_file.refresh_from_db()
assert bank_transaction_csv_file.transactions.count() == 6
@pytest.mark.django_db
def test_bank_import_no_duplicates(bank_transaction_csv_file):
assert bank_transaction_csv_file.transactions.count() == 0
process_bank_csv(bank_transaction_csv_file, None)
bank_transaction_csv_file.refresh_from_db()
assert bank_transaction_csv_file.transactions.count() == 6
process_bank_csv(bank_transaction_csv_file, None)
bank_transaction_csv_file.refresh_from_db()
assert bank_transaction_csv_file.transactions.count() == 6