The call to _get_preferences makes some processing based on the user of the context. In order for those computations to return the right value the context must be set when instanciating the user. issue3068 review1711002