From b9a2e69201e8e5d15f67dc1cd7fdaea4d1a6e561 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Bompard?= Date: Wed, 29 Apr 2015 20:43:07 +0000 Subject: [PATCH] Mailman: add the conffile for unit tests --- roles/mailman/files/settings_test.py | 18 ++++++++++++++++++ roles/mailman/tasks/main.yml | 7 +++++++ 2 files changed, 25 insertions(+) create mode 100644 roles/mailman/files/settings_test.py diff --git a/roles/mailman/files/settings_test.py b/roles/mailman/files/settings_test.py new file mode 100644 index 0000000000..30a515164d --- /dev/null +++ b/roles/mailman/files/settings_test.py @@ -0,0 +1,18 @@ +#-*- coding: utf-8 -*- + +""" +Copy of the Django settings file, but with the database set for unit tests. +""" + +from settings import * +try: + from settings_local import * +except ImportError: + pass + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': ':memory:', + } +} diff --git a/roles/mailman/tasks/main.yml b/roles/mailman/tasks/main.yml index d46951530d..751a7a5860 100644 --- a/roles/mailman/tasks/main.yml +++ b/roles/mailman/tasks/main.yml @@ -151,6 +151,13 @@ tags: - config +- name: install the hyperkitty settings test file + copy: src=settings_test.py + dest="{{ mailman_webui_confdir }}/settings_test.py" + owner=root group=root mode=0600 + tags: + - config + - name: install the hyperkitty urls file copy: src=urls.py dest="{{ mailman_webui_confdir }}/urls.py"