#8780: Various unicode unit tests may fail on MySQL, since test database may be
created without utf-8 character set
--------------------------------------------------------------+-------------
 Reporter:  Richard Davies <[EMAIL PROTECTED]>  |       Owner:  nobody    
   Status:  new                                               |   Milestone:    
        
Component:  Unit test system                                  |     Version:  
SVN       
 Keywords:                                                    |       Stage:  
Unreviewed
Has_patch:  0                                                 |  
--------------------------------------------------------------+-------------
 The MySQL installation notes state that the database character set should
 be utf-8, specified by either "CREATE DATABASE <dbname> CHARACTER SET
 utf8;" or a database-wide default "mysqld -C utf8" or "default-character-
 set = utf8"

 runtests.py creates a new test database, but does not force the character
 set to utf8 when it does so.

 This means that users configured with a database-wide default of utf8 will
 find that runtests.py works fine.

 However, users who only set this for their working Django database, may
 find that the new test database has the wrong character set, in which case
 they will see several tests fail (one example below):

 {{{
 $ ./runtests.py --settings=SETT_mysql basic
 ======================================================================
 FAIL: Doctest: modeltests.basic.models.__test__.API_TESTS
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/home/elastic/django-dev/trunk3/django/test/_doctest.py", line
 2180, in runTest
     raise self.failureException(self.format_failure(new.getvalue()))
 AssertionError: Failed doctest test for
 modeltests.basic.models.__test__.API_TESTS
   File "/home/elastic/django-dev/trunk3/tests/modeltests/basic/models.py",
 line unknown line number, in API_TESTS

 ----------------------------------------------------------------------
 File "/home/elastic/django-dev/trunk3/tests/modeltests/basic/models.py",
 line ?, in modeltests.basic.models.__test__.API_TESTS
 Failed example:
     Article.objects.get(pk=a.id).headline
 Expected:
     u'\u6797\u539f \u3081\u3050\u307f'
 Got:
     u'?? ???'


 ----------------------------------------------------------------------
 Ran 1 test in 0.149s

 FAILED (failures=1)
 }}}

 The answer is probably for the test framework to force a complete "CREATE
 DATABASE <dbname> CHARACTER SET utf8;" when it creates the test database
 when run with the mysql backend.

-- 
Ticket URL: <http://code.djangoproject.com/ticket/8780>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to