Mailman: add unit tests, and adatp to recent code changes

This commit is contained in:
Aurélien Bompard 2014-06-03 13:35:38 +00:00
parent aaa825588e
commit a116e1e34d
4 changed files with 17 additions and 10 deletions

View file

@ -82,14 +82,5 @@ def main():
settings_admin.DATABASES["default"]["NAME"],
)
# HyperKitty unit test database
give_rights(
settings_admin.DATABASES["default"]["HOST"],
settings_admin.DATABASES["default"]["USER"],
settings_admin.DATABASES["default"]["PASSWORD"],
"test_" + settings_admin.DATABASES["default"]["NAME"],
settings_admin.DATABASES["default"]["NAME"] + "app",
)
if __name__ == "__main__": main()

View file

@ -24,6 +24,10 @@ $BASEDIR/bin/pg-give-rights.py
# SELinux contexts
restorecon -r "$BASEDIR"
# Run unit tests
django-admin test --pythonpath $CONFDIR --settings settings_test -P hyperkitty
nose2 kittystore
# Reload Apache to flush the python cache
systemctl reload httpd
# Restart Mailman3 since kittystore was updated

View file

@ -120,6 +120,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=0640
tags:
- config
- name: install the hyperkitty urls file
copy: src=urls.py
dest="{{ mailman_webui_confdir }}/urls.py"

View file

@ -159,7 +159,7 @@ TEMPLATE_DIRS = (
)
AUTHENTICATION_BACKENDS = (
'social_auth.backends.browserid.BrowserIDBackend',
#'social_auth.backends.browserid.BrowserIDBackend', # replaced with django_browserid
'hyperkitty.lib.fedora.FedoraBackend',
'social_auth.backends.google.GoogleBackend',
'social_auth.backends.yahoo.YahooBackend',
@ -190,6 +190,11 @@ INSTALLED_APPS = (
'postorius',
)
import django
if django.VERSION[:2] < (1, 6):
TEST_RUNNER = 'discover_runner.DiscoverRunner'
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.JSONSerializer'
REST_FRAMEWORK = {