Commit 6d051ec2 authored by Michal Čihař's avatar Michal Čihař

Simplify nose test settings by sharing with generic test ones

Issue #461
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 951ba07e
......@@ -28,81 +28,13 @@ are:
- It will let more precise specification of what tests to run.
"""
from weblate.settings_example import *
from weblate.settings_test import *
import os
if 'TRAVIS_DATABASE' in os.environ:
if os.environ['TRAVIS_DATABASE'] == 'mysql':
DATABASES['default']['ENGINE'] = 'django.db.backends.mysql'
DATABASES['default']['NAME'] = 'weblate'
DATABASES['default']['USER'] = 'root'
DATABASES['default']['PASSWORD'] = ''
elif os.environ['TRAVIS_DATABASE'] == 'postgresql':
DATABASES['default']['ENGINE'] = \
'django.db.backends.postgresql_psycopg2'
DATABASES['default']['NAME'] = 'weblate'
DATABASES['default']['USER'] = 'postgres'
DATABASES['default']['PASSWORD'] = ''
# Configure admins
ADMINS = (('Weblate test', 'noreply@weblate.org'), )
# Different root for test repos
GIT_ROOT = '%s/test-repos/' % WEB_ROOT
# Avoid migrating during testsuite
SOUTH_TESTS_MIGRATE = False
# Fake access to Microsoft Translator
MT_MICROSOFT_ID = 'ID'
MT_MICROSOFT_SECRET = 'SECRET'
# Fake Google translate API key
MT_GOOGLE_KEY = 'KEY'
# To get higher limit for testing
MT_MYMEMORY_EMAIL = 'test@weblate.org'
# Enable some machine translations
MACHINE_TRANSLATION_SERVICES = (
'weblate.trans.machine.microsoft.MicrosoftTranslation',
'weblate.trans.machine.dummy.DummyTranslation',
)
# Silent logging setup
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
}
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler'
},
},
'loggers': {
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
'weblate': {
'handlers': [],
'level': 'ERROR',
}
}
}
INSTALLED_APPS = INSTALLED_APPS + ('django_nose', )
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
# Override default test match regexp (?:^|[\\b_\\.-])[Tt]est.
# It will match things like get_test_file which is not a test.
NOSE_ARGS = [r'--match=(?:^|[\b_\./-])^[Tt]est', ]
\ No newline at end of file
NOSE_ARGS = [r'--match=(?:^|[\b_\./-])^[Tt]est', ]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment