diff --git a/colab/accounts/utils/mailman.py b/colab/accounts/utils/mailman.py index 07fe7ac..998c25e 100644 --- a/colab/accounts/utils/mailman.py +++ b/colab/accounts/utils/mailman.py @@ -7,6 +7,8 @@ from django.conf import settings TIMEOUT = 1 +LOGGER = logging.getLogger('colab.mailman') + def get_url(listname=None): if listname: @@ -20,7 +22,7 @@ def subscribe(listname, address): try: requests.put(url, timeout=TIMEOUT, data={'address': address}) except: - logging.exception('Unable to subscribe user') + LOGGER.exception('Unable to subscribe user') return False return True @@ -30,7 +32,7 @@ def unsubscribe(listname, address): try: requests.delete(url, timeout=TIMEOUT, data={'address': address}) except: - logging.exception('Unable to unsubscribe user') + LOGGER.exception('Unable to unsubscribe user') return False return True @@ -56,7 +58,7 @@ def address_lists(address, description=''): try: lists = requests.get(url, timeout=TIMEOUT, params=params) except: - logging.exception('Unable to list mailing lists') + LOGGER.exception('Unable to list mailing lists') return [] return lists.json() diff --git a/colab/tests/settings.py b/colab/tests/settings.py index 9220720..2f636d2 100644 --- a/colab/tests/settings.py +++ b/colab/tests/settings.py @@ -1,5 +1,30 @@ from ..settings import * +LOGGING = { + 'version': 1, + + 'handlers': { + 'null': { + 'level': 'DEBUG', + 'class': 'logging.NullHandler', + }, + }, + + 'loggers': { + 'colab.mailman': { + 'handlers': ['null'], + 'propagate': False, + }, + 'haystack': { + 'handlers': ['null'], + 'propagate': False, + }, + 'pysolr': { + 'handlers': ['null'], + 'propagate': False, + }, + }, +} import os HAYSTACK_CONNECTIONS = { -- libgit2 0.21.2