Fetching contributors…
Cannot retrieve contributors at this time
51 lines (34 sloc) 1.15 KB
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
import os
import pytest
import django
from configurations import importer
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tests.settings')
os.environ.setdefault('DJANGO_CONFIGURATION', 'StandaloneTest')
def pytest_configure():
# Setup command is only available in Django 1.7+ but is required
# to properly initialise the Django app config.
if django.VERSION[1] >= 7:
def webtest_csrf_checks():
return True
def webtest(request, webtest_csrf_checks, transactional_db):
Provide the "app" object from WebTest as a fixture
Taken and adapted from
from django_webtest import DjangoTestApp, WebTestMixin
# Patch settings on startup
wtm = WebTestMixin()
wtm.csrf_checks = webtest_csrf_checks
# Unpatch settings on teardown
return DjangoTestApp()
def splinter_webdriver():
return 'firefox'