This repository has been archived on 2020-09-29. You can view files and clone it, but cannot push or open issues/pull-requests.
flatfilecms/tests/conftest.py

28 lines
692 B
Python

import pytest
@pytest.fixture
def current_directory():
from pathlib import Path
return Path(__file__).parent
@pytest.fixture
def config(current_directory):
from pyramid.testing import testConfig
settings = {
'data_path': current_directory / 'data',
'jinja2.filters': 'join_url = flatfilecms.filters.join_url'
}
with testConfig(settings=settings) as config:
config.include('pyramid_jinja2')
config.add_jinja2_search_path('tests:templates')
config.add_jinja2_search_path('flatfilecms:templates')
yield config
@pytest.fixture
def fake_request():
from pyramid.testing import DummyRequest
return DummyRequest()