Opened 8 years ago

Closed 8 years ago

#7534 closed (fixed)

Django test suite needs charset UTF8 in test database

Reported by: Peter Melvyn <peter.melvyn@…> Owned by: nobody
Component: Testing framework Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

In settings, there is the parameter TEST_DATABASE_CHARSET, which should be used to define default character set for test database. IMHO it should be highlighted in the Chapter "Contributing to Django".

Attachments (3)

contributions_mysql_charset.patch (649 bytes) - added by Peter Melvyn <peter.melvyn@…> 8 years ago.
no-test-db-setting-result.txt (21.9 KB) - added by Peter Melvyn <peter.melvyn@…> 8 years ago.
Charset is not specified in test settings
utf8-test-db-setting-result.txt (6.6 KB) - added by Peter Melvyn <peter.melvyn@…> 8 years ago.
settings.TEST_DATABASE_CHARSET=UTF8

Download all attachments as: .zip

Change History (7)

Changed 8 years ago by Peter Melvyn <peter.melvyn@…>

comment:1 Changed 8 years ago by Bastian Kleineidam <calvin@…>

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

I wonder which tests are failing. Can you provide some error messages?

Changed 8 years ago by Peter Melvyn <peter.melvyn@…>

Charset is not specified in test settings

Changed 8 years ago by Peter Melvyn <peter.melvyn@…>

settings.TEST_DATABASE_CHARSET=UTF8

comment:2 Changed 8 years ago by Peter Melvyn <peter.melvyn@…>

Charset and collation of default MySQL 5.x installation is LATIN1 and LATIN1_SWEDISH_CI. If charset UTF8 is not specified for Django tests, then custom_pk and serializers test fail.
See attached files no-test-db-settings-result.txt (under default conditions) and utf8-test-db-settings-result.txt (having specified in settings.TEST_DATABASE_CHARSET=UTF8 - all UTF8 related errors has disappeared). Tested with InnoDB engine on MySQL 5.0.37-community-nt.

comment:3 Changed 8 years ago by Sung-jin Hong

Component: UncategorizedUnit test system
Triage Stage: UnreviewedAccepted

comment:4 Changed 8 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [7916]) Fixed #7534 -- Added a note about TEST_DATABASE_CHARSET in the contribution documentation. Thanks to Peter Melvyn for the suggestion and initial draft.

Note: See TracTickets for help on using tickets.
Back to Top