Laura10101 / contractor-tax-calculator

0 stars 2 forks source link

Posting and putting rule tiers returns unexpected 400 errors #160

Closed Laura10101 closed 11 months ago

Laura10101 commented 11 months ago

FAILED rules_api/test_views.py::test_post_rule_tier_with_non_existent_rule_id - assert 400 == 404 FAILED rules_api/test_views.py::test_post_valid_rule_tier - assert 400 == 200 FAILED rules_api/test_views.py::test_put_rule_tier_with_non_existent_tier_id - assert 400 == 404 FAILED rules_api/test_views.py::test_put_valid_rule_tier - assert 400 == 200

Laura10101 commented 11 months ago

Added additional validation to the endpoint views to catch DoesNotExist errors and return expected responses. Additionally updated all rule_tier tests to use 'tax_rate' rather than 'tier_rate' when passing the tier's tax rate to the endpoint.