'The response for updating a user will contain the extra fields.
This is specifically testing for updating a username when a value
was not previously set.'

def test_update_returns_new_username_when_adding_username(self):

    token = self.get_scoped_token()
    r = self.create_user()
    id_ = self.get_user_attribute_from_response(r, 'id')
    name = self.get_user_attribute_from_response(r, 'name')
    enabled = self.get_user_attribute_from_response(r, 'enabled')
    r = self.admin_request(method='PUT', path=('/v2.0/users/%s' % id_), token=token, body={'user': {'name': name, 'username': 'new_username', 'enabled': enabled}}, expected_status=http_client.OK)
    self.assertValidUserResponse(r)
    user = self.get_user_from_response(r)
    self.assertEqual('new_username', user.get('username'))
