Django

Code

Changeset 5312

Show
Ignore:
Timestamp:
05/21/07 19:46:08 (2 years ago)
Author:
mtredinnick
Message:

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. :-(

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/unicode/tests/regressiontests/string_lookup/models.py

    r5205 r5312  
    44class Foo(models.Model): 
    55    name = models.CharField(maxlength=50) 
    6     viking = models.CharField(maxlength=50, blank=True) 
     6    friend = models.CharField(maxlength=50, blank=True) 
    77 
    88    def __unicode__(self): 
     
    7272# Regression tests for #3937: make sure we can use unicode characters in 
    7373# queries. 
     74# BUG: These tests fail on MySQL, but it's a problem with the test setup. A 
     75# properly configured UTF-8 database can handle this. 
    7476 
    75 >>> fx = Foo(name='Bjorn', viking=u'Freydís Eiríksdóttir') 
     77>>> fx = Foo(name='Bjorn', friend=u'François') 
    7678>>> fx.save() 
    77 >>> Foo.objects.get(viking__contains=u'\xf3') 
     79>>> Foo.objects.get(friend__contains=u'\xe7') 
    7880<Foo: Foo Bjorn> 
    7981 
    8082# We can also do the above query using UTF-8 strings. 
    81 >>> Foo.objects.get(viking__contains='\xc3\xb3') 
     83>>> Foo.objects.get(friend__contains='\xc3\xa7') 
    8284<Foo: Foo Bjorn> 
    8385"""}