Run tests on multiple Python versions and databases (#424)

* Test against more python versions

* Add testing on MySQL

* Add testing on PostgreSQL
This commit is contained in:
Raphael Michel
2017-03-02 11:59:09 +01:00
committed by GitHub
parent b6f42ecd6d
commit af4a2c7184
6 changed files with 62 additions and 19 deletions

View File

@@ -10,8 +10,11 @@ from pkg_resources import iter_entry_points
from . import __version__
config = configparser.RawConfigParser()
config.read(['/etc/pretix/pretix.cfg', os.path.expanduser('~/.pretix.cfg'), 'pretix.cfg'],
encoding='utf-8')
if 'PRETIX_CONFIG_FILE' in os.environ:
config.read([os.environ.get('PRETIX_CONFIG_FILE')], encoding='utf-8')
else:
config.read(['/etc/pretix/pretix.cfg', os.path.expanduser('~/.pretix.cfg'), 'pretix.cfg'],
encoding='utf-8')
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
DATA_DIR = config.get('pretix', 'datadir', fallback=os.environ.get('DATA_DIR', 'data'))

View File

@@ -4,6 +4,7 @@ import tempfile
tmpdir = tempfile.TemporaryDirectory()
os.environ.setdefault('DATA_DIR', tmpdir.name)
os.environ.setdefault('PRETIX_CONFIG_FILE', 'test/sqlite.cfg')
from pretix.settings import * # NOQA
@@ -33,10 +34,3 @@ CACHES = {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': ':memory:'
}
}

View File

@@ -0,0 +1,7 @@
[database]
backend=mysql
name=pretix
user=root
password=
host=127.0.0.1
port=3306

View File

@@ -0,0 +1,6 @@
[database]
backend=postgresql_psycopg2
name=pretix
user=postgres
password=
host=localhost