Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Added mysql test for travis
Browse files Browse the repository at this point in the history
  • Loading branch information
miterion committed Feb 9, 2017
1 parent 2f210e2 commit f883350
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 4 deletions.
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ addons:
code_climate:
repo_token: 5eba139571641c629d395a5f9bec56f9cbc655ce23579c6febdede10c490c6ce

service: mysql

python:
- "3.4"
- "3.5"

env:
# the Django version from requirements.txt is used
- $DENV=""
# test with mysql database
- DJANGO_SETTINGS_MODULE=pyophase.settings_travis
# the latest Django development version is used
- $DENV="pip install --upgrade --pre Django"

Expand All @@ -32,7 +36,7 @@ install:
- pip install -U pip wheel
- pip install -r requirements.txt
- $DENV
- django-admin --version
# - django-admin --version
- pip install coveralls
- npm install -g bower
- bower install
Expand All @@ -42,6 +46,7 @@ before_script:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
- sleep 3 # give xvfb some time to start
- mysql -e 'CREATE DATABASE pyophase;'

# command to run tests
script:
Expand Down
143 changes: 143 additions & 0 deletions pyophase/settings_travis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
"""
Django settings for pyophase project.
Generated by 'django-admin startproject' using Django 1.8.1.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os

from django.utils.translation import ugettext_lazy as _


BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/1.8/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'w#%&!$am4t$20gu#l*b(z)p3od*1j809+420*e9j=bsmagsy$c'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = []


# Application definition

INSTALLED_APPS = (
'django.contrib.admin',
'django.contrib.admindocs',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'bootstrap3',
'formtools',
'ophasebase',
'website',
'dashboard',
'staff',
'students',
'exam',
'workshops',
'clothing',
)

MIDDLEWARE = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.security.SecurityMiddleware',
)

ROOT_URLCONF = 'pyophase.urls'

LOGIN_REDIRECT_URL = 'website:homepage'

TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'pyophase.wsgi.application'


# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'HOST': 'localhost',
'NAME': 'pyophase',
'USER': 'travis',
'PASSWORD': '',
'OPTIONS': {
'init_command': "SET sql_mode='STRICT_TRANS_TABLES'"
}
}
}



# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/

LANGUAGE_CODE = 'de-de'

TIME_ZONE = 'Europe/Berlin'

USE_I18N = True

USE_L10N = True

USE_TZ = True

LANGUAGES = [
('de', _('German')),
('en', _('English')),
]


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/

STATIC_URL = '/static/'
STATIC_ROOT = 'static'

MEDIA_URL = '/media/'
MEDIA_ROOT = 'media'

SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_BROWSER_XSS_FILTER = True

CSRF_COOKIE_HTTPONLY = True

EMAIL_SUBJECT_PREFIX = "[PYOPHASE] "
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
6 changes: 3 additions & 3 deletions staff/migrations/0008_auto_20160822_1623.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ class Migration(migrations.Migration):
]

operations = [
migrations.DeleteModel(
name='DressSize',
),
migrations.RemoveField(
model_name='person',
name='dress_size',
),
migrations.DeleteModel(
name='DressSize',
),
]

0 comments on commit f883350

Please sign in to comment.