starts tests

This commit is contained in:
Benjamin Dauvergne 2016-02-09 18:09:18 +01:00
parent 710058d8ec
commit ba8ee7abdc
5 changed files with 41 additions and 0 deletions

11
tests/settings.py Normal file
View File

@ -0,0 +1,11 @@
import os.path
INSTALLED_APPS = (
'django.contrib.contenttypes',
'django.contrib.auth',
'django.contrib.sessions',
'django_kerberos',
)
TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), 'templates'),)
ROOT_URLCONF = 'django_kerberos.urls'
SECRET_KEY = 'xxx'

View File

@ -0,0 +1,2 @@
{% block content %}
{% endblock %}

10
tests/test_login.py Normal file
View File

@ -0,0 +1,10 @@
import pytest
import kerberos
def test_login_no_header(client, settings):
print client.get('/login/')
def test_login_negotiate_wrong(client, settings):
print client.get('/login/', HTTP_AUTHORIZATION='Negotiate coin')

0
tests/urls.py Normal file
View File

18
tox.ini Normal file
View File

@ -0,0 +1,18 @@
# Tox (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[testenv]
# django.contrib.auth is not tested it does not work with our templates
setenv=
DJANGO_SETTINGS_MODULE=settings
PYTHONPATH=src:tests
commands =
py.test --cov=src/ tests
usedevelop = True
deps = coverage
pytest
pytest-mock
pytest-django
pytest-cov