Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend tests and fix warning/error handling regression #865

Merged
merged 3 commits into from
Mar 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Release 1.5.0 on 2018-03-2?
**Bug Fixes**
- [#844](https://github.com/OpenSourcePolicyCenter/PolicyBrain/pull/842) - Pass start year to dynamic behavioral - Hank Doupe
- [#851](https://github.com/OpenSourcePolicyCenter/PolicyBrain/pull/851) - Update update CSV builder test labels and un-xfail the CSV test - Hank Doupe
- [#865](https://github.com/OpenSourcePolicyCenter/PolicyBrain/pull/865) - Extend tests and fix warning/error handling regression - Hank Doupe

Release 1.4.4 on 2018-03-08
----------------------------
Expand Down
3 changes: 3 additions & 0 deletions webapp/apps/taxbrain/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ def test_taxbrain_warning_on_widow_param(self):
assert response.status_code == 200
assert response.context['start_year'] == str(START_YEAR)
assert response.context['data_source'] == 'PUF'
assert response.context['form'] is not None

@pytest.mark.parametrize('data_source', ['PUF', 'CPS'])
def test_taxbrain_wildcard_in_validation_params_gives_error(self, data_source):
Expand Down Expand Up @@ -456,6 +457,7 @@ def test_taxbrain_improper_reverse_gives_error1(self):
# Check that redirect happens
assert response.status_code == 200
assert response.context['has_errors'] is True
assert response.context['form'] is not None

def test_taxbrain_improper_reverse_gives_error2(self):
"""
Expand All @@ -472,6 +474,7 @@ def test_taxbrain_improper_reverse_gives_error2(self):
# Check that redirect happens
assert response.status_code == 200
assert response.context['has_errors'] is True
assert response.context['form'] is not None

def test_taxbrain_bool_separated_values(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion webapp/apps/taxbrain/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ def personal_results(request):
return redirect(obj)
# Errors from taxcalc.tbi.reform_warnings_errors
else:
personal_inputs = obj
personal_inputs = post_meta.personal_inputs
start_year = post_meta.start_year
data_source = post_meta.data_source
if data_source == 'PUF':
Expand Down