@@ -54,6 +54,18 @@ def test_get_current_user(staff_user: FFAdminUser, staff_client: APIClient) -> N
5454 "tools" : {"completed" : True , "integrations" : ["integration-1" ]},
5555 },
5656 ),
57+ (
58+ {
59+ "tasks" : [{"name" : "task-1" }],
60+ "tools" : {"completed" : True , "integrations" : ["integration-1" ]},
61+ "hosting_preferences" : ["hosting-preference-1, hosting-preference-2" ],
62+ },
63+ {
64+ "tasks" : [{"name" : "task-1" , "completed_at" : "2025-01-01T12:00:00Z" }],
65+ "tools" : {"completed" : True , "integrations" : ["integration-1" ]},
66+ "hosting_preferences" : ["hosting-preference-1, hosting-preference-2" ],
67+ },
68+ ),
5769 ],
5870)
5971@freeze_time ("2025-01-01T12:00:00Z" )
@@ -96,6 +108,14 @@ def test_get_me_should_return_onboarding_object(
96108 },
97109 {"tasks" , "tools" },
98110 ),
111+ (
112+ {
113+ "tasks" : [{"name" : "task-1" , "completed_at" : "2024-01-01T12:00:00Z" }],
114+ "tools" : {"completed" : True , "integrations" : ["integration-1" ]},
115+ "hosting_preferences" : ["hosting-preference-1, hosting-preference-2" ],
116+ },
117+ {"tasks" , "tools" , "hosting_preferences" },
118+ ),
99119 ],
100120)
101121def test_patch_user_onboarding_updates_only_nested_objects_if_provided (
@@ -128,7 +148,7 @@ def test_patch_user_onboarding_updates_only_nested_objects_if_provided(
128148 ).get ("integrations" )
129149
130150
131- def test_patch_user_onboarding_returns_error_if_tasks_and_tools_are_missing (
151+ def test_patch_user_onboarding_returns_error_if_preferences_tasks_and_tools_are_missing (
132152 staff_user : FFAdminUser ,
133153 staff_client : APIClient ,
134154) -> None :
@@ -141,7 +161,9 @@ def test_patch_user_onboarding_returns_error_if_tasks_and_tools_are_missing(
141161 # Then
142162 assert response .status_code == status .HTTP_400_BAD_REQUEST
143163 assert response .json () == {
144- "non_field_errors" : ["At least one of 'tasks' or 'tools' must be provided." ]
164+ "non_field_errors" : [
165+ "At least one of 'tasks' or 'tools' or 'hosting_preferences' must be provided."
166+ ]
145167 }
146168
147169
0 commit comments