From e30d4e238c315a8cdc979b7827bcf3b73df5e507 Mon Sep 17 00:00:00 2001 From: dandds Date: Thu, 23 Aug 2018 10:11:00 -0400 Subject: [PATCH] expect CLIN data with no commas from the financial verification form --- atst/forms/financial.py | 20 +++++++++----------- tests/routes/test_financial_verification.py | 12 ++++++------ 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/atst/forms/financial.py b/atst/forms/financial.py index 1402daa7..83ee7e37 100644 --- a/atst/forms/financial.py +++ b/atst/forms/financial.py @@ -68,11 +68,9 @@ def validate_task_order_number(field): return True -def formatted_number_to_int(num): - if not num: - return - else: - return int(num.replace(",","")) +def number_to_int(num): + if num: + return int(num) class BaseFinancialForm(ValidatedForm): @@ -171,40 +169,40 @@ class ExtendedFinancialForm(BaseFinancialForm): "
CLIN 0001
-
Unclassified IaaS and PaaS Amount
", validators=[Required()], description="Review your task order document, the amounts for each CLIN must match exactly here", - filters=[formatted_number_to_int] + filters=[number_to_int] ) clin_0003 = StringField( "
CLIN 0003
-
Unclassified Cloud Support Package
", validators=[Required()], description="Review your task order document, the amounts for each CLIN must match exactly here", - filters=[formatted_number_to_int] + filters=[number_to_int] ) clin_1001 = StringField( "
CLIN 1001
-
Unclassified IaaS and PaaS Amount
OPTION PERIOD 1
", validators=[Required()], description="Review your task order document, the amounts for each CLIN must match exactly here", - filters=[formatted_number_to_int] + filters=[number_to_int] ) clin_1003 = StringField( "
CLIN 1003
-
Unclassified Cloud Support Package
OPTION PERIOD 1
", validators=[Required()], description="Review your task order document, the amounts for each CLIN must match exactly here", - filters=[formatted_number_to_int] + filters=[number_to_int] ) clin_2001 = StringField( "
CLIN 2001
-
Unclassified IaaS and PaaS Amount
OPTION PERIOD 2
", validators=[Required()], description="Review your task order document, the amounts for each CLIN must match exactly here", - filters=[formatted_number_to_int] + filters=[number_to_int] ) clin_2003 = StringField( "
CLIN 2003
-
Unclassified Cloud Support Package
OPTION PERIOD 2
", validators=[Required()], description="Review your task order document, the amounts for each CLIN must match exactly here", - filters=[formatted_number_to_int] + filters=[number_to_int] ) diff --git a/tests/routes/test_financial_verification.py b/tests/routes/test_financial_verification.py index d6552846..ccb8c119 100644 --- a/tests/routes/test_financial_verification.py +++ b/tests/routes/test_financial_verification.py @@ -27,12 +27,12 @@ class TestPENumberInForm: extended_data = { "funding_type": "RDTE", "funding_type_other": "other", - "clin_0001": "50,000", - "clin_0003": "13,000", - "clin_1001": "30,000", - "clin_1003": "7,000", - "clin_2001": "30,000", - "clin_2003": "7,000", + "clin_0001": "50000", + "clin_0003": "13000", + "clin_1001": "30000", + "clin_1003": "7000", + "clin_2001": "30000", + "clin_2003": "7000", } def _set_monkeypatches(self, monkeypatch):