mirror of
https://github.com/pretix/pretix.git
synced 2026-05-07 15:34:02 +00:00
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:'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user