Skip to content
This repository has been archived by the owner on Jun 29, 2020. It is now read-only.

Commit

Permalink
Use MySQL on Travis CI
Browse files Browse the repository at this point in the history
  • Loading branch information
giginet committed Feb 11, 2017
1 parent 3faabcf commit 8ddd534
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ python:
before_install:
- ./utils/decrypt-files $password_for_secret_files
- git submodule update --init --recursive
- mysql -uroot -e "create database test_kawaz_travis"
install:
- pip install tox
- pip install coverage coveralls
Expand Down
14 changes: 14 additions & 0 deletions src/kawaz/ci_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# テスト用データーベースの設定
DATABASES = {
'TEST': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'test_kawaz_travis',
'USER': 'root',
'PASSWORD': '',
'HOST': 'localhost',
'PORT': '',
'OPTIONS': {
'connect_timeout': 60,
},
}
}
7 changes: 6 additions & 1 deletion src/kawaz/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
# Kawaz ポータルサイトの設定
#
###############################################################################
import os
from .pre_settings import *
from django.utils.translation import ugettext_lazy as _

IS_CI = os.environ['CI'] and os.environ['TRAVIS']

# セッション暗号化用文字列の指定
SECRET_KEY = 'ここに十分に長いランダムな文字列'

Expand Down Expand Up @@ -324,6 +327,7 @@

# django-debug-toolbar
def show_debug_toolbar(request):
return False
from django.conf import settings
if settings.TESTING:
return False
Expand Down Expand Up @@ -375,4 +379,5 @@ def show_debug_toolbar(request):
try:
from .local_settings import *
except ImportError:
pass
if CI:
from .ci_settings import *

0 comments on commit 8ddd534

Please sign in to comment.