summaryrefslogtreecommitdiff
path: root/tests/modeltests
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-11-16 08:50:06 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-11-16 08:50:06 +0000
commit1418da7ee417dfc85cb2ebd034b95d21fe2ea015 (patch)
tree5ab77d2ef10a45a5d23ed544cab9b9a84474e6b5 /tests/modeltests
parent9d0bacebd2d0fc2b3581dac9acdc631338387921 (diff)
downloaddjango-1418da7ee417dfc85cb2ebd034b95d21fe2ea015.tar.gz
Fixed #6052 -- Worked around a bug in MySQLdb with regards to handling
SafeUnicode (handle SafeString similarly, just to be safe). Based on a patch from sfllaw. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9467 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'tests/modeltests')
-rw-r--r--tests/modeltests/field_defaults/models.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/modeltests/field_defaults/models.py b/tests/modeltests/field_defaults/models.py
index 18afb72a93..f258134147 100644
--- a/tests/modeltests/field_defaults/models.py
+++ b/tests/modeltests/field_defaults/models.py
@@ -1,3 +1,4 @@
+# coding: utf-8
"""
32. Callable defaults
@@ -19,7 +20,7 @@ class Article(models.Model):
def __unicode__(self):
return self.headline
-__test__ = {'API_TESTS':"""
+__test__ = {'API_TESTS': u"""
>>> from datetime import datetime
# No articles are in the system yet.
@@ -51,8 +52,8 @@ True
# make sure that SafeString/SafeUnicode fields work
>>> from django.utils.safestring import SafeUnicode, SafeString
->>> a.headline = SafeUnicode(u'SafeUnicode Headline')
+>>> a.headline = SafeUnicode(u'Iñtërnâtiônàlizætiøn1')
>>> a.save()
->>> a.headline = SafeString(u'SafeString Headline')
+>>> a.headline = SafeString(u'Iñtërnâtiônàlizætiøn1'.encode('utf-8'))
>>> a.save()
"""}