Commits

Peter Sagerson committed ec00812

Use tox for automated testing.

Comments (0)

Files changed (7)

 template, but there are many rich configuration options for working with users,
 groups, and permissions.
 
-This version is officially supported on Python >= 2.5, Django >= 1.3, and
-python-ldap >= 2.0. It is known to work on earlier versions (especially of
-Django) and backwards-compatibility is not broken needlessly, however users of
-older dependencies are urged to test their deployments carefully and be wary of
-updates.
+This version is tested on Python 2.5 to 2.7, Django >= 1.1, and python-ldap
+2.4.13.
 
 Full documentation can be found at http://pythonhosted.org/django-auth-ldap/;
 following is an example configuration, just to whet your appetite::

django_auth_ldap/backend.py

 Additional classes can be found in the config module next to this one.
 """
 
-try:
-    set
-except NameError:
-    from sets import Set as set     # Python 2.3 fallback
-
 import sys
 import traceback
 import pprint

django_auth_ldap/config.py

 notes on naming conventions.
 """
 
-try:
-    set
-except NameError:
-    from sets import Set as set     # Python 2.3 fallback
-
 import logging
 import pprint
 

django_auth_ldap/tests.py

 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
-try:
-    set
-except NameError:
-    from sets import Set as set     # Python 2.3 fallback
-
 from collections import defaultdict
 from copy import deepcopy
 import logging

test/test/settings.py

 
 DATABASES = {
     'default': {
-        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
-        'NAME': '',                      # Or path to database file if using sqlite3.
-        # The following settings are not used with sqlite3:
-        'USER': '',
-        'PASSWORD': '',
-        'HOST': '',                      # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
-        'PORT': '',                      # Set to empty string for default.
+        'ENGINE': 'django.db.backends.sqlite3',
+        'NAME': ':memory:',
     }
 }
 
 
 SECRET_KEY = 'nt56v8)moa)37ta5z7dd=if-@y#k@l7+t8lct*c8m730lpd=so'
 
-ROOT_URLCONF = 'tests.urls'
-WSGI_APPLICATION = 'tests.wsgi.application'
+ROOT_URLCONF = 'test.urls'
+WSGI_APPLICATION = 'test.wsgi.application'
 
 INSTALLED_APPS = (
     'django.contrib.auth',

test/testin.sh

-#!/bin/sh
-
-# A handy script for testing in multiple virtualenvs. Mine are set to the
-# default, but others can be passed as arguments.
-
-if [ "$#" = "0" ]; then
-    virtualenvs=`for x in 1 2 3 4 5; do echo "${HOME}/.virtualenvs/django-1.${x} "; done`
-else
-    virtualenvs="$*"
-fi
-
-
-for venv in ${virtualenvs}; do
-    echo ${venv}
-    source ${venv}/bin/activate
-    python manage.py test django_auth_ldap
-    deactivate
-done
+[tox]
+setupdir = ..
+envlist = py25-django11,
+          py26-django12,
+          py27-django13,
+          py27-django14,
+          py27-django15
+
+[testenv]
+commands = {envpython} manage.py test django_auth_ldap
+deps = python-ldap
+
+[testenv:py25-django11]
+basepython = python2.5
+setenv = PIP_INSECURE=1
+deps = {[testenv]deps}
+       django<1.2
+
+[testenv:py26-django12]
+basepython = python2.6
+deps = {[testenv]deps}
+       django<1.3
+
+[testenv:py27-django13]
+basepython = python2.7
+deps = {[testenv]deps}
+       django<1.4
+
+[testenv:py27-django14]
+basepython = python2.7
+deps = {[testenv]deps}
+       django<1.5
+
+[testenv:py27-django15]
+basepython = python2.7
+deps = {[testenv]deps}
+       django<1.6