1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

unicode: Added a note about some tests that fail for MySQL. Changed the test

data slightly so that it will even fit into a server who's default encoding is
latin1, but still no luck. :-(


git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5312 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2007-05-22 00:46:08 +00:00
parent 6f23be4ee9
commit c2c585f0f0

View File

@ -3,7 +3,7 @@ from django.db import models
class Foo(models.Model): class Foo(models.Model):
name = models.CharField(maxlength=50) name = models.CharField(maxlength=50)
viking = models.CharField(maxlength=50, blank=True) friend = models.CharField(maxlength=50, blank=True)
def __unicode__(self): def __unicode__(self):
return "Foo %s" % self.name return "Foo %s" % self.name
@ -71,13 +71,15 @@ __test__ = {'API_TESTS': ur"""
# Regression tests for #3937: make sure we can use unicode characters in # Regression tests for #3937: make sure we can use unicode characters in
# queries. # queries.
# BUG: These tests fail on MySQL, but it's a problem with the test setup. A
# properly configured UTF-8 database can handle this.
>>> fx = Foo(name='Bjorn', viking=u'Freydís Eiríksdóttir') >>> fx = Foo(name='Bjorn', friend=u'François')
>>> fx.save() >>> fx.save()
>>> Foo.objects.get(viking__contains=u'\xf3') >>> Foo.objects.get(friend__contains=u'\xe7')
<Foo: Foo Bjorn> <Foo: Foo Bjorn>
# We can also do the above query using UTF-8 strings. # We can also do the above query using UTF-8 strings.
>>> Foo.objects.get(viking__contains='\xc3\xb3') >>> Foo.objects.get(friend__contains='\xc3\xa7')
<Foo: Foo Bjorn> <Foo: Foo Bjorn>
"""} """}