Development of an internal social media platform with personalised dashboards for students
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

test_settings.py 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # -*- coding: utf-8 -*-
  2. import django
  3. from distutils.version import StrictVersion
  4. DATABASES = {
  5. 'default': {
  6. 'ENGINE': 'django.db.backends.sqlite3',
  7. },
  8. }
  9. # Default values: True
  10. # POST_OFFICE_CACHE = True
  11. # POST_OFFICE_TEMPLATE_CACHE = True
  12. CACHES = {
  13. 'default': {
  14. 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
  15. 'TIMEOUT': 36000,
  16. 'KEY_PREFIX': 'post-office',
  17. },
  18. 'post_office': {
  19. 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
  20. 'TIMEOUT': 36000,
  21. 'KEY_PREFIX': 'post-office',
  22. }
  23. }
  24. POST_OFFICE = {
  25. 'BACKENDS': {
  26. 'default': 'django.core.mail.backends.dummy.EmailBackend',
  27. 'locmem': 'django.core.mail.backends.locmem.EmailBackend',
  28. 'error': 'post_office.tests.test_backends.ErrorRaisingBackend',
  29. 'smtp': 'django.core.mail.backends.smtp.EmailBackend',
  30. 'connection_tester': 'post_office.tests.test_mail.ConnectionTestingBackend',
  31. }
  32. }
  33. INSTALLED_APPS = (
  34. 'django.contrib.admin',
  35. 'django.contrib.auth',
  36. 'django.contrib.contenttypes',
  37. 'django.contrib.sessions',
  38. 'post_office',
  39. )
  40. SECRET_KEY = 'a'
  41. ROOT_URLCONF = 'post_office.test_urls'
  42. DEFAULT_FROM_EMAIL = 'webmaster@example.com'
  43. if StrictVersion(str(django.get_version())) < '1.10':
  44. MIDDLEWARE_CLASSES = (
  45. 'django.contrib.sessions.middleware.SessionMiddleware',
  46. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  47. )
  48. else:
  49. MIDDLEWARE = [
  50. 'django.contrib.sessions.middleware.SessionMiddleware',
  51. 'django.contrib.auth.middleware.AuthenticationMiddleware',
  52. ]
  53. TEMPLATES = [
  54. {
  55. 'BACKEND': 'django.template.backends.django.DjangoTemplates',
  56. 'DIRS': [],
  57. 'APP_DIRS': True,
  58. 'OPTIONS': {
  59. 'context_processors': [
  60. 'django.contrib.auth.context_processors.auth',
  61. 'django.template.context_processors.debug',
  62. 'django.template.context_processors.i18n',
  63. 'django.template.context_processors.media',
  64. 'django.template.context_processors.static',
  65. 'django.template.context_processors.tz',
  66. 'django.contrib.messages.context_processors.messages',
  67. ],
  68. },
  69. },
  70. ]