'A call to /json/settings with valid parameters changes the user\'s
settings correctly and returns correct values.'

def test_successful_change_settings(self):

    self.login(self.example_email('hamlet'))
    json_result = self.client_patch('/json/settings', dict(full_name='Foo    Bar', old_password=initial_password(self.example_email('hamlet')), new_password='foobar1', confirm_password='foobar1'))
    self.assert_json_success(json_result)
    result = ujson.loads(json_result.content)
    self.check_well_formed_change_settings_response(result)
    self.assertEqual(self.example_user('hamlet').full_name, 'Foo    Bar')
    self.logout()
    self.login(self.example_email('hamlet'), 'foobar1')
    user_profile = self.example_user('hamlet')
    self.assertEqual(get_session_dict_user(self.client.session), user_profile.id)
