"modified the function test_utils/set_preference to accommodate user_id."
It will help setting preferences in case user_id is other than 1(depending on the user which has been logged in).
How would that ever happen? When running the tests, we initialise a new settings database, so we're guaranteed that the user ID will be 1. If it isn't, something is wrong.