Commits

Tim Savage committed 59a8270 Draft

merged changes from GitHub

  • Participants
  • Parent commits 75f10d9

Comments (0)

Files changed (19)

+language: python
+python:
+  - "2.7"
+install: "pip install -r test_harness/requirements.txt --use-mirrors"
+script: python -mtest_harness.runner

File README

-=============
-Django Extras
-=============
-
-Extensions for Django to solve common development situations not (or not yet)
-covered by the core Django framework.
-
-* `Documentation`_
-* `Issue tracker`_
-* `Source code`_
-
-.. _source code: https://github.com/timsavage/django-extras
-.. _documentation: http://django-extras.readthedocs.org
-.. _issue tracker: https://bitbucket.org/timsavage/django-extras/issues
-
-New to Django?
-==============
-
-A visit to the Django getting started guide is a must. The Django project
-provides `very good documentation`_.
-
-.. _very good documentation: http://docs.djangoproject.com
-
-Notice
-======
-
-This project is not supported or endorsed in any way by the Django Software
-Foundation. All source code is released under the same license.
+=============
+Django Extras
+=============
+
+Extensions for Django to solve common development situations not (or not yet)
+covered by the core Django framework.
+
+* `Documentation`_
+* `Issue tracker`_
+* `Source code`_
+
+.. _source code: https://github.com/timsavage/django-extras
+.. _documentation: http://django-extras.readthedocs.org
+.. _issue tracker: https://bitbucket.org/timsavage/django-extras/issues
+
+New to Django?
+==============
+
+A visit to the Django getting started guide is a must. The Django project
+provides `very good documentation`_.
+
+.. _very good documentation: http://docs.djangoproject.com
+
+Notice
+======
+
+This project is not supported or endorsed in any way by the Django Software
+Foundation. All source code is released under the same license.

File django_extras/__init__.py

-VERSION = (0, 2, 6, 'beta', 2)
+VERSION = (0, 2, 7, 'beta', 1)
 
 def get_version():
     # Don't litter django_extras/__init__.py with all the get_version stuff.

File django_extras/contrib/auth/decorators.py

         if user.is_superuser:
             return True
         if raise_exception:
-            raise PermissionDenied
+            raise PermissionDenied()
         return False
     actual_decorator = user_passes_test(check_permission, login_url=login_url)
     if function:
         if user.is_staff or (include_superusers and user.is_superuser):
             return True
         if raise_exception:
-            raise PermissionDenied
+            raise PermissionDenied()
         return False
     actual_decorator = user_passes_test(check_permission, login_url=login_url)
     if function:

File django_extras/contrib/auth/models.py

 # -*- encoding:utf8 -*-
-#from django.contrib.auth.models import *
 from django.db import models
 from django.conf import settings
 

File docs/conf.py

 # The short X.Y version.
 version = '0.2'
 # The full version, including alpha/beta/rc tags.
-release = '0.2.5.b1'
+release = '0.2.7.b1'
 # The next version to be released
 django_next_version = '0.3'
 

File docs/index.txt

 Source code
 ===========
 
-Full `source code`_ is available in Bit Bucket.
+Full `source code`_ is available on Git Hub. Have migrated away from BitBucket for Travis CI support.
 
-.. _source code: https://bitbucket.org/timsavage/django-extras/src
+.. _source code: https://github.com/timsavage/django-extras
 from fabric.api import *
 
 def run_tests():
-    local('python test_runner.py')
+    local('python -mtest_harness.runner')

File fabfile.pyc

Binary file added.

File runtests.py

-import os, sys
-from django.conf import settings
-
-DIRNAME = os.path.dirname(__file__)
-settings.configure(DEBUG=True, INSTALLED_APPS=('django_extras'))
-
-from django.test.simple import run_tests
-
-failures = run_tests(['django_extras',], verbosity=1)
-if failures:
-    sys.exit(failures)
 setup(
     name = "django-extras",
     version = version,
-    url = "https://bitbucket.org/timsavage/django-extras",
+    url = "https://github.com/timsavage/django-extras",
     author = "Tim Savage",
     author_email = "tim.savage@poweredbypenguins.org",
     description = "A selection of extras for the Django Web framework.",
     packages = packages,
     data_files = data_files,
-    requires = ['django'],
+    install_requires = ['django'],
     classifiers = [
         'Development Status :: 4 - Beta',
         'Environment :: Web Environment',

File test_harness/__init__.py

+# -*- coding: utf-8 -*-
+

File test_harness/requirements.txt

+django

File test_harness/runner.py

+# Helper test runner for running tests against django_extras
+from django.conf import settings
+from django.core.management import call_command
+
+
+def main():
+    settings.configure(
+        DEBUG=True,
+        DATABASES={
+            'default': {
+                'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
+                'NAME': ':memory:',                      # Or path to database file if using sqlite3.
+                'USER': '',                      # Not used with sqlite3.
+                'PASSWORD': '',                  # Not used with sqlite3.
+                'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
+                'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
+            }
+        },
+        SECRET_KEY="Test Key",
+        INSTALLED_APPS=(
+            'django.contrib.auth',
+            'django.contrib.contenttypes',
+            'django.contrib.sessions',
+            'django.contrib.sites',
+            'django.contrib.messages',
+            'django.contrib.staticfiles',
+            'django.contrib.admin',
+
+            'django_extras',
+        ),
+        ROOT_URLCONF='test_harness.urls',
+        LOGIN_URL='/login/'
+    )
+    call_command('test', 'django_extras')
+
+
+if __name__ == '__main__':
+    main()

File test_harness/settings.py

+# -*- coding: utf-8 -*-
+
+DEBUG = True
+
+DATABASES = {
+    'default': {
+        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
+        'NAME': ':memory:',                      # Or path to database file if using sqlite3.
+        'USER': '',                      # Not used with sqlite3.
+        'PASSWORD': '',                  # Not used with sqlite3.
+        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
+        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
+    }
+}
+
+SECRET_KEY = "Test Key"
+
+INSTALLED_APPS = (
+    'django.contrib.auth',
+    'django.contrib.contenttypes',
+    'django.contrib.sessions',
+    'django.contrib.sites',
+    'django.contrib.messages',
+    'django.contrib.staticfiles',
+    'django.contrib.admin',
+
+    'django_extras',
+)
+
+ROOT_URLCONF = 'test_harness.urls'
+
+LOGIN_URL = '/login/'

File test_harness/urls.py

+# -*- coding: utf-8 -*-
+from django.conf.urls import patterns
+urlpatterns = patterns('')

File test_runner.py

-# Helper test runner for running tests against django_extras
-import os
-
-from optparse import OptionParser
-
-from django.conf import settings
-from django.core.management import call_command
-
-def main():
-    parser = OptionParser()
-    parser.add_option('--DATABASE_ENGINE', dest='DATABASE_ENGINE', default='django.db.backends.sqlite3')
-    parser.add_option('--DATABASE_NAME',   dest='DATABASE_NAME',   default='test.db')
-    parser.add_option('--DATABASE_USER',   dest='DATABASE_USER',   default='')
-    parser.add_option('--DATABASE_PASSWORD', dest='DATABASE_PASSWORD', default='')
-    parser.add_option('--DATABASE_HOST',   dest='DATABASE_HOST',   default='')
-    parser.add_option('--DATABASE_PORT',   dest='DATABASE_PORT',  default='')
-    parser.add_option('--SITE_ID',         dest='SITE_ID', type='int', default=1)
-
-    options, args = parser.parse_args()
-
-    settings.configure(**{
-        'DATABASES': {
-            'default': {
-                'ENGINE': options.DATABASE_ENGINE,
-                'NAME': options.DATABASE_NAME,
-                'USER': options.DATABASE_USER,
-                'PASSWORD': options.DATABASE_PASSWORD,
-                'HOST': options.DATABASE_HOST,
-                'PORT': options.DATABASE_PORT,
-            },
-        },
-        'SITE_ID': options.SITE_ID,
-        'ROOT_URLCONF': '',
-        'TEMPLATE_LOADERS': (
-            'django.template.loaders.filesystem.load_template_source',
-            'django.template.loaders.app_directories.load_template_source',
-        ),
-        'TEMPLATE_DIRS': (
-            os.path.join(os.path.dirname(__file__), 'templates'),
-        ),
-        'INSTALLED_APPS': (
-            "django.contrib.auth",
-            "django.contrib.contenttypes",
-            "django.contrib.sessions",
-            "django.contrib.sites",
-
-            "django_extras",
-        ),
-    })
-    call_command('test', 'django_extras')
-
-
-if __name__ == '__main__':
-    main()

File test_settings.py

-# -*- coding: utf-8 -*-
-
-DATABASES = {
-    'default': {
-        'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
-        'NAME': ':memory:',                      # Or path to database file if using sqlite3.
-        'USER': '',                      # Not used with sqlite3.
-        'PASSWORD': '',                  # Not used with sqlite3.
-        'HOST': '',                      # Set to empty string for localhost. Not used with sqlite3.
-        'PORT': '',                      # Set to empty string for default. Not used with sqlite3.
-    }
-}
-
-SECRET_KEY = "Test Key"
-
-INSTALLED_APPS = (
-    'django.contrib.auth',
-    'django.contrib.contenttypes',
-    'django.contrib.sessions',
-    'django.contrib.sites',
-    'django.contrib.messages',
-    'django.contrib.staticfiles',
-    'django.contrib.admin',
-
-    'django_extras',
-)
-
-ROOT_URLCONF = ''