summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigi <nagrigoriadis@gmail.com>2014-11-22 05:23:50 (GMT)
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2014-12-11 13:33:49 (GMT)
commite2213b9bdaec5e0a1dfadcfc0613ff129af1b59b (patch)
treebd7d7ad0c4c2a805329525a66c725a1623c19219
parent242815a15ec82b157979b0a3f3dcabbcb6921066 (diff)
downloadauthentic-e2213b9bdaec5e0a1dfadcfc0613ff129af1b59b.zip
authentic-e2213b9bdaec5e0a1dfadcfc0613ff129af1b59b.tar.gz
authentic-e2213b9bdaec5e0a1dfadcfc0613ff129af1b59b.tar.bz2
Added tox as a test-runner.
It will build different virtualenvs for each target. getlasso.sh is somewhat hacky, but until lasso is installable through pip this is the workaround. License: MIT refs #5244
-rw-r--r--.gitignore3
-rw-r--r--MANIFEST.in2
-rwxr-xr-xgetlasso.sh20
-rw-r--r--requirements.txt2
-rwxr-xr-xsetup.py2
-rw-r--r--test_settings34
-rw-r--r--tox.ini25
7 files changed, 85 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 27c6770..bb06776 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,4 +13,5 @@ log.log
authentic2/locale/fr/LC_MESSAGES/django.mo
local_settings.*
*.egg-info
-*.mo \ No newline at end of file
+*.mo
+.tox
diff --git a/MANIFEST.in b/MANIFEST.in
index 91e493f..8d0f4b9 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -44,6 +44,8 @@ include diagnose.py
include ez_setup.py
include authentic2/auth2_auth/auth2_ssl/authentic_ssl.vhost
include requirements.txt
+include test_settings
+include getlasso.sh
include authentic2/vendor/dpam/LICENSE
include authentic2/nonce/README.rst
include doc/conf.py doc/Makefile doc/README.rst.bak
diff --git a/getlasso.sh b/getlasso.sh
new file mode 100755
index 0000000..680da39
--- /dev/null
+++ b/getlasso.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+# Get venv site-packages path
+DSTDIR=`python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'`
+
+# Get not venv site-packages path
+# Remove first path (assuming that is the venv path)
+NONPATH=`echo $PATH | sed 's/^[^:]*://'`
+SRCDIR=`PATH=$NONPATH python -c 'from distutils.sysconfig import get_python_lib; print(get_python_lib())'`
+
+# Clean up
+rm -f $DSTDIR/lasso.*
+rm -f $DSTDIR/_lasso.*
+
+# Link
+ln -sv $SRCDIR/lasso.py $DSTDIR
+ln -sv $SRCDIR/_lasso.* $DSTDIR
+
+exit 0
+
diff --git a/requirements.txt b/requirements.txt
index 26ef68c..53928f4 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,4 +1,4 @@
-Django<1.6
+Django>1.5,<1.7
south>=0.8.4
requests
django-model-utils
diff --git a/setup.py b/setup.py
index 86643c3..13b3130 100755
--- a/setup.py
+++ b/setup.py
@@ -113,7 +113,7 @@ setup(name="authentic2",
scripts = ('authentic2-ctl',),
packages=find_packages(),
include_package_data=True,
- install_requires=['django < 1.6',
+ install_requires=['django >= 1.5, < 1.7',
'south>=0.8.4',
'requests',
'django-model-utils',
diff --git a/test_settings b/test_settings
new file mode 100644
index 0000000..101830c
--- /dev/null
+++ b/test_settings
@@ -0,0 +1,34 @@
+import os.path
+
+DEBUG = False
+
+if DEBUG:
+ DEBUG_TOOLBAR = True
+ TEMPLATE_DEBUG = True
+ DEBUG_TOOLBAR_CONFIG = {
+ 'INTERCEPT_REDIRECTS': False,
+ }
+INTERNAL_IPS = ('127.0.0.1',)
+
+SECRET_KEY = 'coin'
+
+from authentic2.settings import INSTALLED_APPS, \
+ MIDDLEWARE_CLASSES
+
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': os.path.join(os.path.dirname(__file__), 'authentic2.sqlite'),
+ },
+}
+
+if DEBUG:
+ INSTALLED_APPS += ('debug_toolbar',)
+ MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware',)
+
+
+LANGUAGE_CODE = 'en'
+
+IDP_SAML2 = True
+#IDP_OPENID = True
+
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..e7cc245
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,25 @@
+# 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.
+
+[tox]
+envlist = django15, django16
+
+[testenv:django15]
+commands =
+ ./getlasso.sh
+ ln -sf test_settings local_settings.py
+ ./authentic2-ctl test auth contenttypes sessions messages admin_tools theming menu dashboard authentic2
+deps = django>1.5,<1.6
+
+[testenv:django16]
+commands =
+ ./getlasso.sh
+ ln -sf test_settings local_settings.py
+ ./authentic2-ctl test django.contrib.auth django.contrib.contenttypes django.contrib.sessions django.contrib.messages admin_tools authentic2
+deps = django>1.6,<1.7
+
+
+
+