From 28adc08795698260bcdaf1a1a380509ca9524d9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89loi=20Rivard?= Date: Mon, 3 Oct 2022 13:25:13 +0200 Subject: [PATCH] Commands does not executed ldap setup and teardown in testing context --- canaille/commands.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/canaille/commands.py b/canaille/commands.py index b8730abf..09449b8d 100644 --- a/canaille/commands.py +++ b/canaille/commands.py @@ -25,7 +25,8 @@ def clean(): teardown_backend, ) - setup_backend(current_app) + if not current_app.config["TESTING"]: + setup_backend(current_app) for t in Token.all(): if t.is_expired(): @@ -35,7 +36,8 @@ def clean(): if a.is_expired(): a.delete() - teardown_backend(current_app) + if not current_app.config["TESTING"]: + teardown_backend(current_app) @cli.command()