Skip to content

Commit

Permalink
test: skip ldapsync if it is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelebleu authored and tonioo committed Jan 7, 2020
1 parent c0aedd0 commit db12a4a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions modoboa/ldapsync/tests.py
Expand Up @@ -4,16 +4,16 @@

from unittest import skipIf

import ldap

from django.utils import six
from django.utils.encoding import force_bytes, force_str

from modoboa.core import factories as core_factories
from modoboa.lib.tests import NO_LDAP, ModoTestCase
from modoboa.parameters import tools as param_tools

from . import lib
if not NO_LDAP:
import ldap
from . import lib


@skipIf(NO_LDAP, "No ldap module installed")
Expand Down
8 changes: 7 additions & 1 deletion test_project/test_project/settings.py
Expand Up @@ -70,10 +70,16 @@
"modoboa.limits",
"modoboa.parameters",
"modoboa.dnstools",
"modoboa.ldapsync",
# Modoboa extensions here.
)

try:
import ldap # noqa: F401
except ImportError:
pass
else:
MODOBOA_APPS += ("modoboa.ldapsync",)

INSTALLED_APPS += MODOBOA_APPS

AUTH_USER_MODEL = "core.User"
Expand Down

0 comments on commit db12a4a

Please sign in to comment.