Commands does not executed ldap setup and teardown in testing context

This commit is contained in:
Éloi Rivard 2022-10-03 13:25:13 +02:00
parent 23276e60ca
commit 28adc08795

View file

@ -25,7 +25,8 @@ def clean():
teardown_backend, teardown_backend,
) )
setup_backend(current_app) if not current_app.config["TESTING"]:
setup_backend(current_app)
for t in Token.all(): for t in Token.all():
if t.is_expired(): if t.is_expired():
@ -35,7 +36,8 @@ def clean():
if a.is_expired(): if a.is_expired():
a.delete() a.delete()
teardown_backend(current_app) if not current_app.config["TESTING"]:
teardown_backend(current_app)
@cli.command() @cli.command()