forked from CGM_Public/pretix_original
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:
@@ -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'))
|
||||
|
||||
@@ -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:'
|
||||
}
|
||||
}
|
||||
|
||||
7
src/tests/travis_mysql.cfg
Normal file
7
src/tests/travis_mysql.cfg
Normal file
@@ -0,0 +1,7 @@
|
||||
[database]
|
||||
backend=mysql
|
||||
name=pretix
|
||||
user=root
|
||||
password=
|
||||
host=127.0.0.1
|
||||
port=3306
|
||||
6
src/tests/travis_postgres.cfg
Normal file
6
src/tests/travis_postgres.cfg
Normal file
@@ -0,0 +1,6 @@
|
||||
[database]
|
||||
backend=postgresql_psycopg2
|
||||
name=pretix
|
||||
user=postgres
|
||||
password=
|
||||
host=localhost
|
||||
Reference in New Issue
Block a user