'Test the difference in behavior when a username is supplied to update_account_settings.'

def test_update_username_provided(self):

    update_account_settings(self.user, {'name': 'Mickey    Mouse'})
    account_settings = get_account_settings(self.default_request)[0]
    self.assertEqual('Mickey    Mouse', account_settings['name'])
    update_account_settings(self.user, {'name': 'Donald    Duck'}, username=self.user.username)
    account_settings = get_account_settings(self.default_request)[0]
    self.assertEqual('Donald    Duck', account_settings['name'])
    with self.assertRaises(UserNotAuthorized):
        update_account_settings(self.different_user, {'name': 'Pluto'}, username=self.user.username)
