From aae1adcb4c8e1de34d3da0ef5e9f696683609366 Mon Sep 17 00:00:00 2001 From: Antoine Nguyen Date: Thu, 5 May 2016 08:13:58 +0200 Subject: [PATCH] Fix unit test. --- modoboa/admin/tests/test_account.py | 5 +++++ modoboa/core/tests.py | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/modoboa/admin/tests/test_account.py b/modoboa/admin/tests/test_account.py index 2b15f2d64..2c47ea9f4 100644 --- a/modoboa/admin/tests/test_account.py +++ b/modoboa/admin/tests/test_account.py @@ -1,6 +1,7 @@ # coding: utf-8 from django.core.urlresolvers import reverse +from django.test import override_settings from modoboa.core.models import User from modoboa.core import tests as core_tests @@ -154,6 +155,10 @@ class AccountTestCase(ModoTestCase): ) +@override_settings(AUTHENTICATION_BACKENDS=( + 'modoboa.lib.authbackends.LDAPBackend', + 'modoboa.lib.authbackends.SimpleBackend', +)) class LDAPAccountTestCase(core_tests.LDAPTestCaseMixin, ModoTestCase): """Check LDAP related code.""" diff --git a/modoboa/core/tests.py b/modoboa/core/tests.py index 524dbf615..cc27441e4 100644 --- a/modoboa/core/tests.py +++ b/modoboa/core/tests.py @@ -58,8 +58,7 @@ class LDAPTestCaseMixin(object): try: backend.update_user_password( username, password, new_password) - except exceptions.InternalError as exp: - print exp + except exceptions.InternalError: pass else: return