diff --git a/plinth/modules/users/tests/test_actions.py b/plinth/modules/users/tests/test_actions.py index 44de66169..4fd2cdbf7 100644 --- a/plinth/modules/users/tests/test_actions.py +++ b/plinth/modules/users/tests/test_actions.py @@ -24,10 +24,13 @@ _cleanup_groups = None def _is_ldap_set_up(): """Return whether LDAP is set up.""" - return subprocess.call([ - 'ldapsearch', '-Y', 'EXTERNAL', '-H', 'ldapi:///', '-b', - 'ou=groups,dc=thisbox' - ]) == 0 + try: + return subprocess.call([ + 'ldapsearch', '-Y', 'EXTERNAL', '-H', 'ldapi:///', '-b', + 'ou=groups,dc=thisbox' + ]) == 0 + except FileNotFoundError: + return False pytestmark = [