Laura10101 / contractor-tax-calculator

0 stars 2 forks source link

PUT rule tier tests failing with AttributeError #146

Closed Laura10101 closed 11 months ago

Laura10101 commented 11 months ago

FAILED rules_api/test_views.py::test_put_rule_tier_with_null_min_value - AttributeError: 'int' object has no attribute 'id' FAILED rules_api/test_views.py::test_put_rule_tier_with_non_numeric_min_value - AttributeError: 'int' object has no attribute 'id' FAILED rules_api/test_views.py::test_put_rule_tier_with_null_max_value - AttributeError: 'int' object has no attribute 'id' FAILED rules_api/test_views.py::test_put_rule_tier_with_non_numeric_max_value - AttributeError: 'int' object has no attribute 'id' FAILED rules_api/test_views.py::test_put_rule_tier_with_null_ordinal - AttributeError: 'int' object has no attribute 'id' FAILED rules_api/test_views.py::test_put_rule_tier_with_non_numeric_ordinal - AttributeError: 'int' object has no attribute 'id' FAILED rules_api/test_views.py::test_put_rule_tier_with_null_tier_rate - AttributeError: 'int' object has no attribute 'id' FAILED rules_api/test_views.py::test_put_rule_tier_with_non_numeric_tier_rate - AttributeError: 'int' object has no attribute 'id' FAILED rules_api/test_views.py::test_put_valid_rule_tier - AttributeError: 'int' object has no attribute 'id'

Laura10101 commented 11 months ago

The tests were using the create_rule_tier() service to create the tier before updating. This service returns the id of the object rather than the object itself. The test was then attempting to access the id property on this result. Updated the test code to accept the tier_id directly from the service.