@pytest.fixture(scope='function')
def webtest(request, webtest_csrf_checks, transactional_db):
    from django_webtest import DjangoTestApp, WebTestMixin

    # Patch settings on startup
    wtm = WebTestMixin()
    wtm.csrf_checks = webtest_csrf_checks
    wtm._patch_settings()

    # Unpatch settings on teardown
    request.addfinalizer(wtm._unpatch_settings)

    return DjangoTestApp()
Provide the "app" object from WebTest as a fixture
dataset/ETHPy150Open tangentlabs/django-fancypages/conftest.py/webtest