-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
249 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
language: python | ||
cache: pip | ||
python: | ||
- "2.7" | ||
|
||
env: | ||
- DB="POSTGRESQL" | ||
- DB="MYSQL" | ||
|
||
services: | ||
- mysql | ||
- postgres | ||
|
||
before_install: | ||
- pip install codecov | ||
- if [[ $DB = 'POSTGRESQL' ]]; then pip install -q psycopg2; fi | ||
- if [[ $DB = 'MYSQL' ]]; then pip install -q mysqlclient; fi | ||
|
||
install: | ||
- pip install -e git+https://github.com/tonioo/modoboa.git#egg=modoboa | ||
- pip install -q factory-boy testfixtures | ||
- python setup.py -q develop | ||
|
||
before_script: | ||
- if [[ $DB = 'POSTGRESQL' ]]; then psql -c 'create database modoboa_test;' -U postgres; fi | ||
- if [[ $DB = 'MYSQL' ]]; then mysql -e "create database IF NOT EXISTS modoboa_test;" -uroot; fi | ||
- if [[ $DB = 'MYSQL' ]]; then mysql -e "CREATE USER 'modoboa'@'localhost' IDENTIFIED BY 'modoboa'" -uroot; fi | ||
- if [[ $DB = 'MYSQL' ]]; then mysql -e "GRANT ALL PRIVILEGES ON * . * TO 'modoboa'@'localhost';" -uroot; fi | ||
|
||
script: | ||
- cd test_project | ||
- coverage run --source ../modoboa_amavis manage.py test modoboa_webmail | ||
|
||
after_success: | ||
- codecov | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env python | ||
import os | ||
import sys | ||
|
||
if __name__ == "__main__": | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_project.settings") | ||
|
||
from django.core.management import execute_from_command_line | ||
|
||
execute_from_command_line(sys.argv) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
""" | ||
Django settings for test_project project. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/1.6/topics/settings/ | ||
For the full list of settings and their values, see | ||
https://docs.djangoproject.com/en/1.6/ref/settings/ | ||
""" | ||
|
||
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) | ||
import os | ||
from logging.handlers import SysLogHandler | ||
|
||
from modoboa.test_settings import * | ||
|
||
BASE_DIR = os.path.dirname(os.path.dirname(__file__)) | ||
|
||
|
||
# Quick-start development settings - unsuitable for production | ||
# See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ | ||
|
||
# SECURITY WARNING: keep the secret key used in production secret! | ||
SECRET_KEY = 'w537@nm@5n)=+e%-7*z-jxf21a#0k%uv^rbu**+cj4=_u57e(8' | ||
|
||
# SECURITY WARNING: don't run with debug turned on in production! | ||
DEBUG = False | ||
|
||
TEMPLATE_DEBUG = False | ||
|
||
ALLOWED_HOSTS = [ | ||
'localhost' | ||
] | ||
|
||
SITE_ID = 1 | ||
|
||
# Application definition | ||
|
||
INSTALLED_APPS = ( | ||
'django.contrib.auth', | ||
'django.contrib.contenttypes', | ||
'django.contrib.sessions', | ||
'django.contrib.messages', | ||
'django.contrib.sites', | ||
'django.contrib.staticfiles', | ||
'reversion', | ||
|
||
) | ||
|
||
# A dedicated place to register Modoboa applications | ||
# Do not delete it. | ||
# Do not change the order. | ||
MODOBOA_APPS = ( | ||
'modoboa', | ||
'modoboa.core', | ||
'modoboa.lib', | ||
'modoboa.admin', | ||
'modoboa.relaydomains', | ||
'modoboa.limits', | ||
'modoboa.parameters', | ||
# Modoboa extensions here. | ||
'modoboa_webmail', | ||
|
||
) | ||
|
||
INSTALLED_APPS += MODOBOA_APPS | ||
|
||
AUTH_USER_MODEL = 'core.User' | ||
|
||
MIDDLEWARE_CLASSES = ( | ||
'x_forwarded_for.middleware.XForwardedForMiddleware', | ||
'django.contrib.sessions.middleware.SessionMiddleware', | ||
'django.middleware.common.CommonMiddleware', | ||
'django.middleware.csrf.CsrfViewMiddleware', | ||
'django.contrib.auth.middleware.AuthenticationMiddleware', | ||
'django.contrib.messages.middleware.MessageMiddleware', | ||
'django.middleware.locale.LocaleMiddleware', | ||
'django.middleware.clickjacking.XFrameOptionsMiddleware', | ||
'modoboa.core.middleware.LocalConfigMiddleware', | ||
'modoboa.lib.middleware.AjaxLoginRedirect', | ||
'modoboa.lib.middleware.CommonExceptionCatcher', | ||
'modoboa.lib.middleware.RequestCatcherMiddleware', | ||
) | ||
|
||
AUTHENTICATION_BACKENDS = ( | ||
'django.contrib.auth.backends.ModelBackend', | ||
) | ||
|
||
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.template.context_processors.i18n', | ||
'django.template.context_processors.media', | ||
'django.template.context_processors.static', | ||
'django.template.context_processors.tz', | ||
'django.contrib.messages.context_processors.messages', | ||
'modoboa.core.context_processors.top_notifications', | ||
], | ||
'debug': False, | ||
}, | ||
}, | ||
] | ||
|
||
ROOT_URLCONF = 'test_project.urls' | ||
|
||
WSGI_APPLICATION = 'test_project.wsgi.application' | ||
|
||
|
||
# Internationalization | ||
# https://docs.djangoproject.com/en/1.6/topics/i18n/ | ||
|
||
LANGUAGE_CODE = 'en-us' | ||
|
||
TIME_ZONE = 'UTC' | ||
|
||
USE_I18N = True | ||
|
||
USE_L10N = False | ||
|
||
USE_TZ = True | ||
|
||
|
||
# Static files (CSS, JavaScript, Images) | ||
# https://docs.djangoproject.com/en/1.6/howto/static-files/ | ||
|
||
STATIC_URL = '/sitestatic/' | ||
STATIC_ROOT = os.path.join(BASE_DIR, 'sitestatic') | ||
STATICFILES_DIRS = ( | ||
|
||
) | ||
|
||
MEDIA_URL = '/media/' | ||
MEDIA_ROOT = os.path.join(BASE_DIR, 'media') | ||
|
||
# Modoboa settings | ||
#MODOBOA_CUSTOM_LOGO = os.path.join(MEDIA_URL, "custom_logo.png") | ||
|
||
#DOVECOT_LOOKUP_PATH = ('/path/to/dovecot', ) | ||
|
||
MODOBOA_API_URL = 'http://api.modoboa.org/1/' | ||
|
||
# Logging configuration | ||
|
||
LOGGING = { | ||
'version': 1, | ||
'formatters': { | ||
'syslog': { | ||
'format': '%(name)s: %(levelname)s %(message)s' | ||
}, | ||
}, | ||
'handlers': { | ||
'syslog-auth': { | ||
'class': 'logging.handlers.SysLogHandler', | ||
'facility': SysLogHandler.LOG_AUTH, | ||
'formatter': 'syslog' | ||
}, | ||
'modoboa': { | ||
'class': 'modoboa.core.loggers.SQLHandler', | ||
} | ||
}, | ||
'loggers': { | ||
'modoboa.auth': { | ||
'handlers': ['syslog-auth', 'modoboa'], | ||
'level': 'INFO', | ||
'propagate': False | ||
}, | ||
'modoboa.admin': { | ||
'handlers': ['modoboa'], | ||
'level': 'INFO', | ||
'propagate': False | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.conf.urls import include, url | ||
|
||
urlpatterns = [ | ||
url(r'', include('modoboa.urls')), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
""" | ||
WSGI config for test_project project. | ||
It exposes the WSGI callable as a module-level variable named ``application``. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/1.7/howto/deployment/wsgi/ | ||
""" | ||
|
||
import os | ||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_project.settings") | ||
|
||
from django.core.wsgi import get_wsgi_application | ||
application = get_wsgi_application() |