chrono/tests/conftest.py

26 lines
551 B
Python

import django_webtest
import pytest
@pytest.fixture
def app(request):
wtm = django_webtest.WebTestMixin()
wtm.setup_auth = False
wtm._patch_settings()
request.addfinalizer(wtm._unpatch_settings)
return django_webtest.DjangoTestApp()
@pytest.fixture(autouse=True)
def media_root(settings, tmpdir):
settings.MEDIA_ROOT = str(tmpdir.mkdir('media_root'))
@pytest.fixture
def nocache(settings):
settings.CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
}
}