Skip to content

Commit c067021

Browse files
committed
Fix mysql tests collation
1 parent 2005f09 commit c067021

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

runtests.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,30 @@
5959
'sqlite': 'django.db.backends.sqlite3',
6060
}
6161

62+
EXTRA = {
63+
'django.db.backends.postgresql_psycopg2': {
64+
'TEST': {'CHARSET': 'utf8'},
65+
},
66+
'django.db.backends.mysql': {
67+
'TEST': {'CHARSET': 'utf8', 'COLLATION': 'utf8_general_ci'},
68+
},
69+
}
70+
6271
#=============================================================================
6372

6473
def parse_database(url):
6574
url = urlparse(url)
66-
return {
67-
'ENGINE': ENGINES[url.scheme],
75+
engine = ENGINES[url.scheme]
76+
result = {
77+
'ENGINE': engine,
6878
'NAME': url.path.strip('/'),
6979
'HOST': url.hostname,
7080
'PORT': url.port,
7181
'USER': url.username,
7282
'PASSWORD': url.password,
73-
'CHARSET': 'utf8',
74-
'COLLATION': 'utf8_general_ci',
7583
}
84+
result.update(EXTRA.get(engine, {}))
85+
return result
7686

7787
#=============================================================================
7888

0 commit comments

Comments
 (0)