Skip to content
Browse files

Make tests compatible with Django 1.3

  • Loading branch information...
1 parent abc9e77 commit 6df74159b00643918f4e36965dd21d8ded936fc5 @mbraak mbraak committed Feb 13, 2013
Showing with 14 additions and 31 deletions.
  1. +7 −1 fiber/tests.py
  2. +0 −29 testproject/testproject/settings_default.py
  3. +7 −1 testproject/testproject/urls.py
View
8 fiber/tests.py
@@ -1,6 +1,12 @@
import re
-from django.conf.urls import patterns, url
+try:
+ # Django >= 1.4
+ from django.conf.urls import patterns, url
+except ImportError:
+ # Django 1.3
+ from django.conf.urls.defaults import patterns, url
+
from django.views.generic import View
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
View
29 testproject/testproject/settings_default.py
@@ -125,35 +125,6 @@
'django.contrib.admin',
)
-# A sample logging configuration. The only tangible logging
-# performed by this configuration is to send an email to
-# the site admins on every HTTP 500 error when DEBUG=False.
-# See http://docs.djangoproject.com/en/dev/topics/logging for
-# more details on how to customize your logging configuration.
-LOGGING = {
- 'version': 1,
- 'disable_existing_loggers': False,
- 'filters': {
- 'require_debug_false': {
- '()': 'django.utils.log.RequireDebugFalse'
- }
- },
- 'handlers': {
- 'mail_admins': {
- 'level': 'ERROR',
- 'filters': ['require_debug_false'],
- 'class': 'django.utils.log.AdminEmailHandler'
- }
- },
- 'loggers': {
- 'django.request': {
- 'handlers': ['mail_admins'],
- 'level': 'ERROR',
- 'propagate': True,
- },
- }
-}
-
try:
import django_jenkins
installed_apps = list(INSTALLED_APPS)
View
8 testproject/testproject/urls.py
@@ -1,5 +1,11 @@
+try:
+ # Django >= 1.4
+ from django.conf.urls import patterns, include
+except ImportError:
+ # Django 1.3
+ from django.conf.urls.defaults import patterns, include
+
from django.conf import settings
-from django.conf.urls import patterns, include
from django.conf.urls.static import static
from django.contrib import admin

0 comments on commit 6df7415

Please sign in to comment.
Something went wrong with that request. Please try again.