Merge "Creating new user does not require project"

This commit is contained in:
Jenkins 2015-10-08 03:57:27 +00:00 committed by Gerrit Code Review
commit 97044c82ef
2 changed files with 16 additions and 1 deletions

View File

@ -88,7 +88,7 @@ class Users(generic.View):
name=request.DATA['name'],
email=request.DATA.get('email') or None,
password=request.DATA.get('password'),
project=request.DATA.get('project_id'),
project=request.DATA.get('project_id') or None,
enabled=True,
domain=domain.id
)

View File

@ -122,6 +122,21 @@ class KeystoneRestTestCase(test.TestCase):
}
)
def test_user_create_no_project(self):
self._test_user_create(
'{"name": "bob", '
'"password": "sekrit", "project_id": "", '
'"email": "spam@company.example"}',
{
'name': 'bob',
'password': 'sekrit',
'email': 'spam@company.example',
'project': None,
'domain': 'the_domain',
'enabled': True
}
)
def test_user_create_partial(self):
self._test_user_create(
'{"name": "bob"}',