forked from filhocf/ideax
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconftest.py
More file actions
35 lines (25 loc) · 845 Bytes
/
conftest.py
File metadata and controls
35 lines (25 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import logging
from django.core.management import call_command
from django.db import connection
from django.utils import translation
from pytest import fixture
pytest_plugins = [
'ideax.tests.fixtures',
'ideax.users.tests.fixtures',
'ideax.ideax.tests.fixtures',
]
@fixture(scope='session', autouse=True)
def test_info(worker_id):
# TODO: Search for a better way to run this code only once by node
if worker_id in ('master', 'gw0'):
logging.warn(f'Database vendor: {connection.vendor}')
@fixture(scope='session')
def django_db_setup(django_db_setup, django_db_blocker):
with django_db_blocker.unblock():
call_command('loaddata', 'docker/initialdata.json')
@fixture(autouse=True)
def set_default_language():
translation.activate('en')
@fixture
def db_vendor(db):
return connection.vendor