diff --git a/testing/test_settings.py b/testing/test_settings.py index 1bd0dbb..bc083ae 100755 --- a/testing/test_settings.py +++ b/testing/test_settings.py @@ -40,6 +40,13 @@ ALLOWED_HOSTS = ['localhost'] + +# Mailman API credentials for testing +MAILMAN_REST_API_URL = 'http://localhost:9001' +MAILMAN_REST_API_USER = 'restadmin' +MAILMAN_REST_API_PASS = 'restpass' + + # Application definition INSTALLED_APPS = ( @@ -70,7 +77,6 @@ # is the only app you want to serve. ROOT_URLCONF = 'testing.urls' -# List of callables that know how to import templates from various sources. TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', @@ -78,7 +84,6 @@ 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ - 'django.contrib.auth.context_processors.auth', 'django.template.context_processors.debug', 'django.template.context_processors.i18n', 'django.template.context_processors.media', @@ -86,6 +91,7 @@ 'django.template.context_processors.tz', 'django.template.context_processors.csrf', 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', 'postorius.context_processors.postorius', ], @@ -106,6 +112,7 @@ } } + # Internationalization # https://docs.djangoproject.com/en/{{ docs_version }}/topics/i18n/ @@ -126,18 +133,6 @@ STATIC_URL = '/static/' -AUTHENTICATION_BACKENDS = ( - 'django.contrib.auth.backends.ModelBackend', - 'django_browserid.auth.BrowserIDBackend', -) - - -# Mailman API credentials for testing -MAILMAN_REST_API_URL = 'http://localhost:9001' -MAILMAN_REST_API_USER = 'restadmin' -MAILMAN_REST_API_PASS = 'restpass' - - LOGIN_URL = 'user_login' LOGIN_REDIRECT_URL = 'list_index' LOGOUT_URL = 'user_logout' @@ -147,6 +142,19 @@ BROWSERID_USERNAME_ALGO = username +# Compatibility with Bootstrap 3 +from django.contrib.messages import constants as messages +MESSAGE_TAGS = { + messages.ERROR: 'danger' +} + + +AUTHENTICATION_BACKENDS = ( + 'django.contrib.auth.backends.ModelBackend', + 'django_browserid.auth.BrowserIDBackend', +) + + # Set VCR_RECORD_MODE to 'all' to re-record all API responses. # (Remember to use an empty mailman database!) VCR_RECORD_MODE = 'once' diff --git a/testing/urls.py b/testing/urls.py index b8aefdd..9558d4c 100644 --- a/testing/urls.py +++ b/testing/urls.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 1998-2012 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2016 by the Free Software Foundation, Inc. # # This file is part of Postorius. # @@ -19,7 +19,6 @@ import postorius from django.conf.urls import include, url -from django.conf import settings urlpatterns = [ url('', include('django_browserid.urls')),