'Username is set as the value of name if no username is provided.
This matches the v2.0 spec where we really should be using username
and not name.'

def test_updated_username_is_returned(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, 'enabled': enabled}}, expected_status=http_client.OK)
    self.assertValidUserResponse(r)
    user = self.get_user_from_response(r)
    self.assertEqual(user.get('name'), user.get('username'))
