From 3ac3130fc9daf853368947b268d9af4b8a67d247 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Thu, 10 Feb 2011 13:29:52 -0500 Subject: Convert json strings to unicode when they are unmarshalled. This patch removes some individual work-arounds of converting strings to unicode, they only masked the problem. String values are not passed to the validator or normalizers so things like adding the realm automatically to services weren't happening. ticket 941 --- tests/test_ipalib/test_parameters.py | 2 +- tests/test_xmlrpc/test_user_plugin.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/test_ipalib/test_parameters.py b/tests/test_ipalib/test_parameters.py index e90a2625a..ffdc864b6 100644 --- a/tests/test_ipalib/test_parameters.py +++ b/tests/test_ipalib/test_parameters.py @@ -922,7 +922,7 @@ class test_Str(ClassChecker): mthd = o._convert_scalar for value in (u'Hello', 42, 1.2, unicode_str): assert mthd(value) == unicode(value) - bad = [True, dict(one=1)] + bad = [True, 'Hello', dict(one=1), utf8_bytes] for value in bad: e = raises(errors.ConversionError, mthd, value) assert e.name == 'my_str' diff --git a/tests/test_xmlrpc/test_user_plugin.py b/tests/test_xmlrpc/test_user_plugin.py index ad5d21423..d8d95b9fe 100644 --- a/tests/test_xmlrpc/test_user_plugin.py +++ b/tests/test_xmlrpc/test_user_plugin.py @@ -510,8 +510,8 @@ class test_user(Declarative): desc='Create %r with a full address' % user1, command=( 'user_add', [user1], dict(givenname=u'Test', sn=u'User1', - street='123 Maple Rd', locality='Anytown', st='MD', - telephonenumber='410-555-1212',) + street=u'123 Maple Rd', locality=u'Anytown', st=u'MD', + telephonenumber=u'410-555-1212',) ), expected=dict( value=user1, -- cgit