add abandoned status to distinguish given-up habits from completed ones
Completed and abandoned habits were both lumped under a single terminal state, making it impossible to tell "finished successfully" apart from "gave up" when reviewing habit history.
This commit is contained in:
@@ -70,6 +70,18 @@ def test_complete_and_reactivate_habit(auth_client, db_session, test_user):
|
||||
assert reactivate_res.json()["status"] == "active"
|
||||
|
||||
|
||||
def test_abandon_and_reactivate_habit(auth_client, db_session, test_user):
|
||||
habit = _make_habit(db_session, test_user.id)
|
||||
|
||||
abandon_res = auth_client.post(f"/api/habits/{habit.id}/abandon")
|
||||
assert abandon_res.status_code == 200
|
||||
assert abandon_res.json()["status"] == "abandoned"
|
||||
|
||||
reactivate_res = auth_client.post(f"/api/habits/{habit.id}/reactivate")
|
||||
assert reactivate_res.status_code == 200
|
||||
assert reactivate_res.json()["status"] == "active"
|
||||
|
||||
|
||||
def test_reorder_endpoint(auth_client, db_session, test_user):
|
||||
a = _make_habit(db_session, test_user.id, name="A")
|
||||
b = _make_habit(db_session, test_user.id, name="B")
|
||||
|
||||
Reference in New Issue
Block a user