From f179ac2ccda79b1e8b0911975549df6d0c9b5f82 Mon Sep 17 00:00:00 2001 From: Andreas Madsack Date: Sat, 13 Jan 2018 14:03:47 +0100 Subject: [PATCH] add test for no-duplicates on bank import --- byro_shackspace/tests/test_bank_import.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/byro_shackspace/tests/test_bank_import.py b/byro_shackspace/tests/test_bank_import.py index c5b6d7d..10830b8 100644 --- a/byro_shackspace/tests/test_bank_import.py +++ b/byro_shackspace/tests/test_bank_import.py @@ -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