Test init_command for mysql
This commit is contained in:
parent
912e66eff1
commit
39dedb70bd
3 changed files with 5 additions and 15 deletions
|
|
@ -47,14 +47,14 @@ DATABASES = {
|
||||||
'HOST': 'localhost',
|
'HOST': 'localhost',
|
||||||
'PORT': '', # use default port
|
'PORT': '', # use default port
|
||||||
'OPTIONS': {
|
'OPTIONS': {
|
||||||
# 'read_default_file': '.travis/my.conf',
|
'charset': 'utf8mb4',
|
||||||
'charset': 'utf8mb4'
|
'init_command': 'set collation_connection=utf8mb4_unicode_ci'
|
||||||
},
|
},
|
||||||
'TEST': {
|
'TEST': {
|
||||||
'NAME': 'default',
|
'NAME': 'default',
|
||||||
'OPTIONS': {
|
'OPTIONS': {
|
||||||
# 'read_default_file': '.travis/my.conf'
|
'charset': 'utf8mb4',
|
||||||
'charset': 'utf8mb4'
|
'init_command': 'set collation_connection=utf8mb4_unicode_ci'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,6 @@ from django.test import override_settings
|
||||||
from evennia.utils.test_resources import unload_module
|
from evennia.utils.test_resources import unload_module
|
||||||
|
|
||||||
|
|
||||||
class TestDatabase(TestCase):
|
|
||||||
def test_database(self):
|
|
||||||
|
|
||||||
import subprocess
|
|
||||||
# subprocess.call(["mysql", "-u", "root", '-e "SHOW TABLE STATUS;"', "evennia"], shell=True)
|
|
||||||
subprocess.call("mysql -u root -e \"SHOW TABLE STATUS;\" evennia", shell=True)
|
|
||||||
|
|
||||||
|
|
||||||
@patch("evennia.server.server.LoopingCall", new=MagicMock())
|
@patch("evennia.server.server.LoopingCall", new=MagicMock())
|
||||||
class TestServer(TestCase):
|
class TestServer(TestCase):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -31,9 +31,7 @@ class EvenniaUsernameAvailabilityValidator:
|
||||||
)
|
)
|
||||||
|
|
||||||
# Check database
|
# Check database
|
||||||
exists = AccountDB.objects.filter(username__iexact=username)
|
exists = AccountDB.objects.filter(username__iexact=username).exists()
|
||||||
print("\nusernamevalidator query: {}".format(exists.query))
|
|
||||||
exists = exists.exists()
|
|
||||||
if exists:
|
if exists:
|
||||||
raise ValidationError(
|
raise ValidationError(
|
||||||
_('Sorry, that username is already taken.'),
|
_('Sorry, that username is already taken.'),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue