"""
Django settings for test project.

Generated by 'django-admin startproject' using Django 1.8.17.

For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os

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

SECRET_KEY = 'not_so_secret_secret_key'
SITE_ID = 1

DEBUG = True

ALLOWED_HOSTS = []

# Application definition

INSTALLED_APPS = (
    # adhocracy4 base apps
    'adhocracy4.organisations.apps.OrganisationsConfig',
    'adhocracy4.projects.apps.ProjectsConfig',
    'adhocracy4.modules.apps.ModulesConfig',
    'adhocracy4.phases.apps.PhasesConfig',
    'adhocracy4.reports.apps.ReportsConfig',
    'adhocracy4.comments.apps.CommentsConfig',
    'adhocracy4.maps.apps.MapsConfig',
    'adhocracy4.actions.apps.ActionsConfig',
    'adhocracy4.follows.apps.FollowsConfig',
    'adhocracy4.filters.apps.FiltersConfig',
    'adhocracy4.forms.apps.FormsConfig',
    'adhocracy4.rules.apps.RulesConfig',
    'adhocracy4.dashboard.apps.DashboardConfig',

    # adhocrayc4 generic apps
    'adhocracy4.ratings.apps.RatingsConfig',
    'adhocracy4.categories.apps.CategoriesConfig',
    'adhocracy4.labels.apps.LabelsConfig',

    # adhocracy4 helper apps
    'adhocracy4.ckeditor.apps.CKEditorConfig',
    'adhocracy4.images.apps.ImagesConfig',

    # test apps
    'tests.apps.questions.apps.QuestionsConfig',
    'tests.apps.locations.apps.LocationsConfig',
    'tests.apps.ideas.apps.IdeasConfig',

    # mandatory third party apps
    'easy_thumbnails',
    'rules.apps.AutodiscoverRulesConfig',
    'background_task',

    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.sites',
    'django.contrib.staticfiles',
)

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

ROOT_URLCONF = 'tests.project.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            os.path.join(PROJECT_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',
            ],
        },
    },
]

WSGI_APPLICATION = 'tests.project.wsgi.application'

# Auth
# https://docs.djangoproject.com/en/1.8/topics/auth/customizing/

AUTHENTICATION_BACKENDS = (
    'rules.permissions.ObjectPermissionBackend',
    'django.contrib.auth.backends.ModelBackend',
    'allauth.account.auth_backends.AuthenticationBackend',
)



# Database
# https://docs.djangoproject.com/en/1.8/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
        'TEST': {
            'NAME': os.path.join(BASE_DIR, 'test_db.sqlite3'),
        }
    }
}


# Internationalization
# https://docs.djangoproject.com/en/1.8/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.8/howto/static-files/

STATIC_URL = '/static/'

MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/media/'


# Adhcoracy 4

A4_ORGANISATIONS_MODEL = 'a4organisations.Organisation'
A4_RATEABLES = (('a4test_questions', 'question'), ('a4comments', 'comment'),)
A4_REPORTABLES = (('a4test_questions', 'question'),)
A4_COMMENTABLES = (('a4test_questions', 'question'),
                   ('a4comments', 'comment'),)
A4_ACTIONABLES = ()
A4_AUTO_FOLLOWABLES = (('a4comments', 'comment'),)
A4_CATEGORIZABLE = (('a4test_questions', 'question'),)
A4_DASHBOARD = {
    'BLUEPRINTS': 'tests.project.blueprints.blueprints'
}


# Rich text fields

BLEACH_LIST = {
    'default' : {
        'tags': ['p','strong','em','u','ol','li','ul','a'],
        'attributes': {
            'a': ['href', 'rel'],
        },
    },
    'image-editor': {
        'tags': ['p','strong','em','u','ol','li','ul','a','img'],
        'attributes': {
            'a': ['href', 'rel'],
            'img': ['src', 'alt', 'style']
        },
        'styles': [
            'float',
            'margin',
            'padding',
            'width',
            'height',
            'margin-bottom',
            'margin-top',
            'margin-left',
            'margin-right',
        ],
    },
    'collapsible-image-editor': {
        'tags': ['p','strong','em','u','ol','li','ul','a','img','div'],
        'attributes': {
            'a': ['href', 'rel'],
            'img': ['src', 'alt', 'style'],
            'div': ['class'],
        },
        'styles': [
            'float',
            'margin',
            'padding',
            'width',
            'height',
            'margin-bottom',
            'margin-top',
            'margin-left',
            'margin-right',
        ],
    }
}

LOGIN_URL = "/accounts/login"

IMAGE_ALIASES = {
    '*': {'max_size': 5*10**6, 'fileformats': ('image/png', 'image/jpeg', 'image/gif')},
    'heroimage': {'min_resolution': (1300, 600)},
    'tileimage': {'min_resolution': (500, 300)},
}

@@ -4527,16 +4527,39 @@
 ion'),)%0A
+A4_LABELS_ADDABLE = ()%0A
 A4_DASHB

fix settings for test