def test_validate_date_is_within_a_financial_year_raises_validation_error(): start_date = '2019-08-01' end_date = '2019-06-01' with pytest.raises(expected_exception=InvalidRequest) as e: validate_date_range_is_within_a_financial_year(start_date, end_date) assert e.value.message == 'Start date must be before end date' assert e.value.status_code == 400
def test_validate_date_is_within_a_financial_year_when_input_is_not_a_date( start_date, end_date): with pytest.raises(expected_exception=InvalidRequest) as e: validate_date_range_is_within_a_financial_year(start_date, end_date) assert e.value.message == 'Input must be a date in the format: YYYY-MM-DD' assert e.value.status_code == 400
def test_validate_date_range_is_within_a_financial_year_raises( start_date, end_date): with pytest.raises(expected_exception=InvalidRequest) as e: validate_date_range_is_within_a_financial_year(start_date, end_date) assert e.value.message == 'Date must be in a single financial year.' assert e.value.status_code == 400
def test_validate_date_range_is_within_a_financial_year(start_date, end_date): validate_date_range_is_within_a_financial_year(start_date, end_date)