Skip to content
Snippets Groups Projects
Commit 408ab6df authored by Neda Moeini's avatar Neda Moeini
Browse files

Add unittest for cheque fields validation.

parent ac6813db
No related branches found
No related tags found
1 merge request!5Feature/cheque cols should be empty
......@@ -92,3 +92,11 @@ def test_validate_nc_cc_dep_combination_against_meo_sage_account(
assert ("Row 1: 'NominalAnalysisNominalCostCentre/1' (Invalid_CC) is not a valid cost centre."
in str(form.errors["file"][0]))
def test_cheque_fields_must_be_empty(sample_input_file: SimpleUploadedFile, mock_meo_database: MagicMock) -> None:
"""Test that cheque fields must be empty."""
modified_file = create_modified_csv(sample_input_file,
{"ChequeCurrencyName": "USD", "ChequeToBankExchangeRate": "1"})
form = CSVUploadForm(files={"file": modified_file})
assert not form.is_valid()
assert "Row 1: Unexpected values in the Cheque columns. All cheque columns must be empty." in form.errors["file"][0]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment