Skip to content

Commit

Permalink
Rename test_settings.py to settings_test.py
Browse files Browse the repository at this point in the history
There can be a problem with test discovery otherwise
  • Loading branch information
stefanw committed Mar 1, 2013
1 parent 93369f3 commit aa26683
Show file tree
Hide file tree
Showing 3 changed files with 106 additions and 387 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export DJANGO_SETTINGS_MODULE=froide.test_settings
export DJANGO_SETTINGS_MODULE=froide.settings_test

test:
pep8 --ignore=E501,E124,E126,E127,E128 --exclude=migrations froide
Expand Down
105 changes: 105 additions & 0 deletions froide/settings_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# -*- coding: utf-8 -*-
# Django settings for froide project.

from .settings import * # noqa

DEBUG = False

TEMPLATE_DEBUG = False

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'test.db', # 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.
}
}

# 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.
# 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,
'handlers': {
'mail_admins': {
'level': 'ERROR',
'class': 'django.utils.log.AdminEmailHandler'
},
'sentry.errors': {
'level': 'DEBUG',
'class': 'django.utils.log.AdminEmailHandler'
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
}
},
'loggers': {
'froide': {
'handlers': ['console'],
'propagate': True,
'level': 'DEBUG',
},
'sentry.errors': {
'level': 'DEBUG',
'handlers': ['console'],
'propagate': True
},
'django.request': {
'handlers': ['mail_admins'],
'level': 'ERROR',
'propagate': True,
},
}
}

MESSAGE_STORAGE = 'django.contrib.messages.storage.cookie.CookieStorage'

CACHES = {
'default': {
# 'BACKEND': 'django.core.cache.backends.dummy.DummyCache',
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
}
}

TEST_RUNNER = 'discover_runner.DiscoverRunner'

# 'chrome' or 'firefox' or 'phantomjs'
TEST_SELENIUM_DRIVER = 'phantomjs'

# south settings

SOUTH_TESTS_MIGRATE = False

USE_X_ACCEL_REDIRECT = True

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

DEFAULT_FROM_EMAIL = '[email protected]'

# Default test domain
FOI_EMAIL_DOMAIN = 'fragdenstaat.de'

HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://127.0.0.1:9200/',
'INDEX_NAME': 'froide',
},
}

HAYSTACK_SIGNAL_PROCESSOR = 'celery_haystack.signals.CelerySignalProcessor'

CELERY_HAYSTACK_MODELS = ('foirequest.FoiRequest', 'publicbody.PublicBody')

CELERY_RESULT_BACKEND = "database"
CELERY_RESULT_DBURI = "sqlite:///dev.db"

CELERYBEAT_SCHEDULER = "djcelery.schedulers.DatabaseScheduler"
CELERY_ALWAYS_EAGER = True
Loading

0 comments on commit aa26683

Please sign in to comment.