diff --git a/tests/unittests/general/webfront_test.py b/tests/unittests/general/webfront_test.py index 5b23d931d5..23f538df01 100644 --- a/tests/unittests/general/webfront_test.py +++ b/tests/unittests/general/webfront_test.py @@ -178,6 +178,9 @@ def test_remote_user_set(self): ) +@pytest.mark.skipif( + not nav.web.auth.ldap.available, reason="ldap module is not available" +) class TestLdapUser(object): @patch.dict( "nav.web.auth.ldap._config._sections", @@ -277,6 +280,9 @@ def fake_search(base, scope, filtr): }, }, ) +@pytest.mark.skipif( + not nav.web.auth.ldap.available, reason="ldap module is not available" +) class TestLdapEntitlements(object): def test_required_entitlement_should_be_verified(self, user_zaphod): u = nav.web.auth.ldap.LDAPUser("zaphod", user_zaphod) diff --git a/tests/unittests/web/ldapauth_test.py b/tests/unittests/web/ldapauth_test.py index 2655f1166d..757ad9434b 100644 --- a/tests/unittests/web/ldapauth_test.py +++ b/tests/unittests/web/ldapauth_test.py @@ -1,8 +1,16 @@ +import pytest + +import nav.web.auth.ldap from nav.config import NAVConfigParser from nav.web.auth.ldap import LDAPUser, open_ldap from mock import Mock, patch +pytestmark = pytest.mark.skipif( + not nav.web.auth.ldap.available, reason="ldap module is not available" +) + + class LdapTestConfig(NAVConfigParser): DEFAULT_CONFIG_FILES = [] DEFAULT_CONFIG = u"""