Commits

Peter Sagerson committed c3b945a

Simplify test project and move tox.ini to the top level.

Comments (0)

Files changed (13)

setup.cfg

-[flake8]
-ignore = E501
         "Development Status :: 5 - Production/Stable",
         "Environment :: Web Environment",
         "Programming Language :: Python",
+        "Programming Language :: Python, :: 2",
         "Framework :: Django",
         "Intended Audience :: Developers",
         "Intended Audience :: System Administrators",
+[run]
+source = django_auth_ldap.config
+         django_auth_ldap.backend

test/django_auth_ldap

-../django_auth_ldap
 
 
 if __name__ == "__main__":
-    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test.settings")
+    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
 
     from django.core.management import execute_from_command_line
 
+# For older versions of Djano
+DATABASE_ENGINE = 'sqlite3'
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.sqlite3',
+        'NAME': ':memory:',
+    }
+}
+
+ALLOWED_HOSTS = []
+
+TIME_ZONE = 'UTC'
+LANGUAGE_CODE = 'en-us'
+USE_I18N = False
+USE_L10N = False
+USE_TZ = True
+
+SECRET_KEY = 'nt56v8)moa)37ta5z7dd=if-@y#k@l7+t8lct*c8m730lpd=so'
+
+ROOT_URLCONF = 'urls'
+
+INSTALLED_APPS = (
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+
+    'django_auth_ldap',
+)

test/test/__init__.py

Empty file removed.

test/test/settings.py

-# For older versions of Djano
-DATABASE_ENGINE = 'sqlite3'
-
-DATABASES = {
-    'default': {
-        'ENGINE': 'django.db.backends.sqlite3',
-        'NAME': ':memory:',
-    }
-}
-
-ALLOWED_HOSTS = []
-
-TIME_ZONE = 'UTC'
-LANGUAGE_CODE = 'en-us'
-USE_I18N = False
-USE_L10N = False
-USE_TZ = True
-
-SECRET_KEY = 'nt56v8)moa)37ta5z7dd=if-@y#k@l7+t8lct*c8m730lpd=so'
-
-ROOT_URLCONF = 'test.urls'
-WSGI_APPLICATION = 'test.wsgi.application'
-
-INSTALLED_APPS = (
-    'django.contrib.auth',
-    'django.contrib.contenttypes',
-    'django.contrib.sessions',
-
-    'django_auth_ldap',
-)

test/test/urls.py

-from django.conf.urls import patterns
-
-
-urlpatterns = patterns('')

test/test/wsgi.py

-"""
-WSGI config for tests project.
-
-This module contains the WSGI application used by Django's development server
-and any production WSGI deployments. It should expose a module-level variable
-named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
-this application via the ``WSGI_APPLICATION`` setting.
-
-Usually you will have the standard Django WSGI application here, but it also
-might make sense to replace the whole Django WSGI application with a custom one
-that later delegates to the Django one. For example, you could introduce WSGI
-middleware here, or combine a Django application with an application of another
-framework.
-
-"""
-import os
-
-# We defer to a DJANGO_SETTINGS_MODULE already in the environment. This breaks
-# if running multiple sites in the same mod_wsgi process. To fix this, use
-# mod_wsgi daemon mode with each site in its own daemon process, or use
-# os.environ["DJANGO_SETTINGS_MODULE"] = "tests.settings"
-os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test.settings")
-
-# This application object is used by any WSGI server configured to use this
-# file. This includes Django's development server, if the WSGI_APPLICATION
-# setting points here.
-from django.core.wsgi import get_wsgi_application
-application = get_wsgi_application()
-
-# Apply WSGI middleware here.
-# from helloworld.wsgi import HelloWorldApplication
-# application = HelloWorldApplication(application)

test/tox.ini

-[tox]
-skipsdist = true
-envlist = py25-django13,
-          py26-django14,
-          py27-django15,
-          py27-django16
-
-[testenv]
-commands = {envpython} manage.py test django_auth_ldap
-deps = mockldap
-
-[testenv:py25-django13]
-basepython = python2.5
-setenv = PIP_INSECURE=1
-deps = {[testenv]deps}
-       django<1.4
-
-[testenv:py26-django14]
-basepython = python2.6
-deps = {[testenv]deps}
-       django<1.5
-
-[testenv:py27-django15]
-basepython = python2.7
-deps = {[testenv]deps}
-       django<1.5
-
-[testenv:py27-django16]
-basepython = python2.7
-deps = {[testenv]deps}
-       https://www.djangoproject.com/download/1.6b4/tarball/
+from django.conf.defaults import patterns
+
+
+urlpatterns = patterns('')
+[flake8]
+ignore = E501
+
+
+[tox]
+envlist = py25-django13,
+          py26-django14,
+          py27-django15,
+          py27-django16
+
+[testenv]
+changedir = test
+commands = {envpython} manage.py test django_auth_ldap
+deps = mockldap
+
+[testenv:py25-django13]
+basepython = python2.5
+setenv = PIP_INSECURE=1
+deps = {[testenv]deps}
+       django<1.4
+
+[testenv:py26-django14]
+basepython = python2.6
+deps = {[testenv]deps}
+       django<1.5
+
+[testenv:py27-django15]
+basepython = python2.7
+deps = {[testenv]deps}
+       django<1.5
+
+[testenv:py27-django16]
+basepython = python2.7
+deps = {[testenv]deps}
+       https://www.djangoproject.com/download/1.6b4/tarball/