'Illustrate the inconsistent handling of hyphens in keys.
To quote Morgan in bug 1526244:
the reason this is converted from "domain-id" to "domain_id" is
because of how we process/normalize data. The way we have to handle
specific data types for known columns requires avoiding "-" in the
actual python code since "-" is not valid for attributes in python
w/o significant use of "getattr" etc.
In short, historically we handle some things in conversions. The
use of "extras" has long been a poor design choice that leads to
odd/strange inconsistent behaviors because of other choices made in
handling data from within the body. (In many cases we convert from
"-" to "_" throughout openstack)
Source: https://bugs.launchpad.net/keystone/+bug/1526244/comments/9'

def test_user_management_normalized_keys(self):

    self.auth = self.build_authentication_request(user_id=self.domain_admin_user['id'], password=self.domain_admin_user['password'], domain_id=self.domainA['id'])
    r = self.get(('/users/%s' % self.just_a_user['id']), auth=self.auth, expected_status=http_client.OK)
    self.assertValidUserResponse(r)
    self.get(('/users?domain-id=%s' % self.domainA['id']), auth=self.auth, expected_status=exception.ForbiddenAction.code)
    self.get(('/users?domain-id=%s' % self.domainB['id']), auth=self.auth, expected_status=exception.ForbiddenAction.code)
    r = self.patch(('/users/%s' % self.just_a_user['id']), auth=self.auth, body={'user': {'domain-id': self.domainB['id']}}, expected_status=http_client.OK)
    self.assertEqual(self.domainB['id'], r.json['user']['domain-id'])
    self.assertEqual(self.domainA['id'], r.json['user']['domain_id'])
    self.assertNotEqual(self.domainB['id'], self.just_a_user['domain_id'])
    self.assertValidUserResponse(r, self.just_a_user)
    user_ref = unit.new_user_ref(domain_id=self.domainA['id'])
    r = self.post('/users', auth=self.auth, body={'user': user_ref}, expected_status=http_client.CREATED)
    self.assertValidUserResponse(r, ref=user_ref)
    user_ref['domain-id'] = user_ref.pop('domain_id')
    self.post('/users', auth=self.auth, body={'user': user_ref}, expected_status=exception.ForbiddenAction.code)
