In the regression suite, I ran the model model_regress and it fails
with the following error:-
Database - MYSQL
Platform - Windows
BrokenUnicodeMethod.objects.all()
Expected:
[<BrokenUnicodeMethod: [Bad Unicode data]>]
Got:
[<BrokenUnicodeMethod: Názov: Jerry>]
On Linux this test case runs fine.
The following code breaks in the test case:-
class BrokenUnicodeMethod(models.Model):
name = models.CharField(max_length=7)
def __unicode__(self):
return 'Názov: %s' %
self.name
# Models with broken unicode methods should still have a printable
repr
>>> b = BrokenUnicodeMethod(name="Jerry")
>>> b.save()
>>> BrokenUnicodeMethod.objects.all()
[<BrokenUnicodeMethod: [Bad Unicode data]>]
The tests case tries to insert unicode data into a string type and it
should throw an exception in models/base.py on __repr__.
On Linux it runs fine and throws an exception but on windows this test
case fails with the above output. Is anyone else facing the same
problem with Unicode or am I missing something here?
Thanks in advance for the help.