diff options
author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-04-26 09:58:44 +0000 |
---|---|---|
committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-04-26 09:58:44 +0000 |
commit | 0da72ff885ee4e21214e477f883497e30ddee404 (patch) | |
tree | 83457fd30505ede28b95074020d58870abea6636 /tests | |
parent | dfc553625dc13e95df5d90cc11c33e359d59fb11 (diff) | |
download | django-0da72ff885ee4e21214e477f883497e30ddee404.tar.gz |
unicode: Fixed #4152 -- Converted a lot of internal [n]gettext() calls into
u[n]gettext() calls. Thanks, Ivan Sagalaev.
git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5082 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests')
-rw-r--r-- | tests/modeltests/manipulators/models.py | 10 | ||||
-rw-r--r-- | tests/modeltests/validation/models.py | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/tests/modeltests/manipulators/models.py b/tests/modeltests/manipulators/models.py index 1a44cfe7f4..e1c2e6d767 100644 --- a/tests/modeltests/manipulators/models.py +++ b/tests/modeltests/manipulators/models.py @@ -41,24 +41,24 @@ True # Attempt to add a Musician without a first_name. >>> man.get_validation_errors(MultiValueDict({'last_name': ['Blakey']})) -{'first_name': ['This field is required.']} +{'first_name': [u'This field is required.']} # Attempt to add a Musician without a first_name and last_name. >>> man.get_validation_errors(MultiValueDict({})) -{'first_name': ['This field is required.'], 'last_name': ['This field is required.']} +{'first_name': [u'This field is required.'], 'last_name': [u'This field is required.']} # Attempt to create an Album without a name or musician. >>> man = Album.AddManipulator() >>> man.get_validation_errors(MultiValueDict({})) -{'musician': ['This field is required.'], 'name': ['This field is required.']} +{'musician': [u'This field is required.'], 'name': [u'This field is required.']} # Attempt to create an Album with an invalid musician. >>> man.get_validation_errors(MultiValueDict({'name': ['Sallies Fforth'], 'musician': ['foo']})) -{'musician': ["Select a valid choice; 'foo' is not in ['', '1']."]} +{'musician': [u"Select a valid choice; 'foo' is not in ['', '1']."]} # Attempt to create an Album with an invalid release_date. >>> man.get_validation_errors(MultiValueDict({'name': ['Sallies Fforth'], 'musician': ['1'], 'release_date': 'today'})) -{'release_date': ['Enter a valid date in YYYY-MM-DD format.']} +{'release_date': [u'Enter a valid date in YYYY-MM-DD format.']} # Create an Album without a release_date (because it's optional). >>> data = MultiValueDict({'name': ['Ella and Basie'], 'musician': ['1']}) diff --git a/tests/modeltests/validation/models.py b/tests/modeltests/validation/models.py index b31f981aac..474287154a 100644 --- a/tests/modeltests/validation/models.py +++ b/tests/modeltests/validation/models.py @@ -42,7 +42,7 @@ __test__ = {'API_TESTS':""" >>> p = Person(**dict(valid_params, id='foo')) >>> p.validate() -{'id': ['This value must be an integer.']} +{'id': [u'This value must be an integer.']} >>> p = Person(**dict(valid_params, id=None)) >>> p.validate() @@ -76,7 +76,7 @@ False >>> p = Person(**dict(valid_params, is_child='foo')) >>> p.validate() -{'is_child': ['This value must be either True or False.']} +{'is_child': [u'This value must be either True or False.']} >>> p = Person(**dict(valid_params, name=u'Jose')) >>> p.validate() @@ -116,7 +116,7 @@ datetime.date(2000, 5, 3) >>> p = Person(**dict(valid_params, birthdate='foo')) >>> p.validate() -{'birthdate': ['Enter a valid date in YYYY-MM-DD format.']} +{'birthdate': [u'Enter a valid date in YYYY-MM-DD format.']} >>> p = Person(**dict(valid_params, favorite_moment=datetime.datetime(2002, 4, 3, 13, 23))) >>> p.validate() @@ -144,10 +144,10 @@ u'john@example.com' >>> p = Person(**dict(valid_params, email=22)) >>> p.validate() -{'email': ['Enter a valid e-mail address.']} +{'email': [u'Enter a valid e-mail address.']} # Make sure that Date and DateTime return validation errors and don't raise Python errors. >>> Person(name='John Doe', is_child=True, email='abc@def.com').validate() -{'favorite_moment': ['This field is required.'], 'birthdate': ['This field is required.']} +{'favorite_moment': [u'This field is required.'], 'birthdate': [u'This field is required.']} """} |