import os
import sys
import django


BASE_DIR = os.path.dirname(os.path.dirname(__file__))

sys.path.insert(0, os.path.join(BASE_DIR, 'src'))

DEBUG = True

ADMINS = (
    ('admin', 'admin@location'),
)

MANAGERS = ADMINS

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': 'test_db.sqlite3',
    }
}

TIME_ZONE = 'America/Chicago'

LANGUAGE_CODE = 'en-us'
USE_I18N = True
USE_L10N = True

ROOT_URLCONF = 'tests.url'

SITE_ID = 1

MEDIA_ROOT = ''

MEDIA_URL = ''

SECRET_KEY = '#($gm0!3&=yy^-3aka=0#y#2b1i$qn51tc$vpmplum1_$az8-='

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
)

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'tests.urls'

if django.VERSION >= (1, 10):
    TEMPLATES = [
        {
            'BACKEND': 'django.template.backends.django.DjangoTemplates',
            'DIRS': [os.path.join(BASE_DIR, 'templates')],
            'APP_DIRS': True,
            'OPTIONS': {
                'context_processors': [
                    'django.template.context_processors.debug',
                    'django.template.context_processors.request',
                    'django.contrib.auth.context_processors.auth',
                    'django.contrib.messages.context_processors.messages',
                ],
            },
        },
    ]
else:
    TEMPLATE_DEBUG = DEBUG
    TEMPLATE_DIRS = (
    )

    TEMPLATE_LOADERS = (
        'django.template.loaders.filesystem.Loader',
        'django.template.loaders.app_directories.Loader',
    )

INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'notification',
    'notification.tests',
)

AUTHENTICATION_BACKENDS = (
    'django.contrib.auth.backends.ModelBackend',
)

TEST_RUNNER = 'notification.tests.compatibility.TestRunner'

STATIC_ROOT = 'staticfiles'
STATIC_URL = '/static/'

@@ -572,31 +572,61 @@
 ='%0A%0A
-MIDDLEWARE_CLASSES = (%0A
+if django.VERSION %3E= (1, 10):%0A    MIDDLEWARE = %5B%0A    
     
@@ -640,37 +640,41 @@
 .middleware.
-common.Common
+security.Security
 Middleware',
@@ -666,32 +666,36 @@
 ityMiddleware',%0A
+    
     'django.cont
@@ -730,32 +730,89 @@
 ionMiddleware',%0A
+        'django.middleware.common.CommonMiddleware',%0A    
     'django.midd
@@ -836,32 +836,36 @@
 iewMiddleware',%0A
+    
     'django.cont
@@ -903,32 +903,36 @@
 ionMiddleware',%0A
+    
     'django.cont
@@ -979,26 +979,12 @@
 e',%0A
-)%0A%0AMIDDLEWARE = %5B%0A
+    
     
@@ -1006,83 +1006,124 @@
 are.
-security.SecurityMiddleware',%0A    'django.contrib.sessions.middleware.Sessi
+clickjacking.XFrameOptionsMiddleware',%0A    %5D%0Aelse:%0A    MIDDLEWARE_CLASSES = (%0A        'django.middleware.common.Comm
 onMi
@@ -1125,32 +1125,36 @@
 monMiddleware',%0A
+    
     'django.midd
@@ -1149,38 +1149,49 @@
 'django.
-middleware.common.Comm
+contrib.sessions.middleware.Sessi
 onMiddle
@@ -1193,32 +1193,36 @@
 iddleware',%0A    
+  
+  
 'django.middlewa
@@ -1242,32 +1242,36 @@
 iewMiddleware',%0A
+    
     'django.cont
@@ -1309,32 +1309,36 @@
 ionMiddleware',%0A
+    
     'django.cont
@@ -1389,67 +1389,9 @@
     
-'django.middleware.clickjacking.XFrameOptionsMiddleware',%0A%5D
+)
 %0A%0ARO

Modify tests.settings of MIDDLEWARE #1