From 716f4027ee57c146f3b472f1edae0c11503240c3 Mon Sep 17 00:00:00 2001 From: galstrom21 Date: Wed, 12 Jun 2013 12:39:48 -0500 Subject: Add checks to test if enabled is bool fixes: bug #1167593 Change-Id: Ie18fa17f16383f31d8aa083e69fa501d80eb4553 --- tests/test_backend.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'tests/test_backend.py') diff --git a/tests/test_backend.py b/tests/test_backend.py index 57f3315c..9e506928 100644 --- a/tests/test_backend.py +++ b/tests/test_backend.py @@ -1553,7 +1553,19 @@ class IdentityTests(object): 'fake1', user) - def test_create_user_invalid_enabled_type(self): + def test_create_project_invalid_enabled_type_string(self): + project = {'id': uuid.uuid4().hex, + 'name': uuid.uuid4().hex, + 'domain_id': DEFAULT_DOMAIN_ID, + # invalid string value + 'enabled': "true"} + self.assertRaises(exception.ValidationError, + self.identity_man.create_project, + EMPTY_CONTEXT, + project['id'], + project) + + def test_create_user_invalid_enabled_type_string(self): user = {'id': uuid.uuid4().hex, 'name': uuid.uuid4().hex, 'domain_id': DEFAULT_DOMAIN_ID, @@ -1561,7 +1573,8 @@ class IdentityTests(object): # invalid string value 'enabled': "true"} self.assertRaises(exception.ValidationError, - self.identity_man.create_user, EMPTY_CONTEXT, + self.identity_man.create_user, + EMPTY_CONTEXT, user['id'], user) -- cgit