From 4bde62cf71f5b2e988e803ce9cb6b4e332c9cd23 Mon Sep 17 00:00:00 2001 From: alejandromumo Date: Mon, 18 Nov 2024 14:07:01 +0100 Subject: [PATCH] tests: remove nested db session --- tests/requests/test_user_moderation_actions.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/requests/test_user_moderation_actions.py b/tests/requests/test_user_moderation_actions.py index 764eecd2b..17c2a6b79 100644 --- a/tests/requests/test_user_moderation_actions.py +++ b/tests/requests/test_user_moderation_actions.py @@ -24,16 +24,14 @@ class MockRequestModerationTask(Task): def apply_async(self, args=None, kwargs=None, **kwargs_): user_id = kwargs["user_id"] - with db.session.begin_nested(): - try: - current_user_moderation_service.request_moderation( - system_identity, user_id=user_id, uow=None - ) - except Exception: - pass + try: + current_user_moderation_service.request_moderation( + system_identity, user_id=user_id, uow=None + ) + except Exception as ex: + pass -@pytest.mark.skip(reason="Faulty test") def test_user_moderation_approve( running_app, mod_identity, unverified_user, es_clear, minimal_record, mocker ):