From ebfcf878183401509d6644e68bdbedef7530050c Mon Sep 17 00:00:00 2001 From: Ido Shraga Date: Mon, 15 Apr 2024 12:18:35 +0300 Subject: [PATCH] testers --- tests/test_mongodb.py | 30 +++++++++++++++--------------- tests/test_sqlalchemy.py | 4 +++- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/tests/test_mongodb.py b/tests/test_mongodb.py index 329751b2..278c529b 100644 --- a/tests/test_mongodb.py +++ b/tests/test_mongodb.py @@ -58,18 +58,18 @@ def test_lifetime(self, app_utils, _session_permanent, _session_refresh_each_request): pytest.skip("TTL index issue") - # with self.setup_mongo(): - # - # app = app_utils.create_app( - # { - # "SESSION_TYPE": "mongodb", - # "SESSION_MONGODB": self.client, - # "SESSION_PERMANENT": _session_permanent, - # "SESSION_REFRESH_EACH_REQUEST": _session_refresh_each_request, - # "PERMANENT_SESSION_LIFETIME": timedelta(seconds=5), - # } - # ) - # - # with app.test_request_context(): - # assert isinstance(flask.session, MongoDBSession) - # self._test_lifetime(app, _session_permanent) + with self.setup_mongo(): + + app = app_utils.create_app( + { + "SESSION_TYPE": "mongodb", + "SESSION_MONGODB": self.client, + "SESSION_PERMANENT": _session_permanent, + "SESSION_REFRESH_EACH_REQUEST": _session_refresh_each_request, + "PERMANENT_SESSION_LIFETIME": timedelta(seconds=5), + } + ) + + with app.test_request_context(): + assert isinstance(flask.session, MongoDBSession) + self._test_lifetime(app, _session_permanent) diff --git a/tests/test_sqlalchemy.py b/tests/test_sqlalchemy.py index 27630ba6..1340ec7c 100644 --- a/tests/test_sqlalchemy.py +++ b/tests/test_sqlalchemy.py @@ -1,6 +1,6 @@ import json from contextlib import contextmanager -from datetime import timedelta +from datetime import timedelta, datetime import flask import pytest @@ -63,6 +63,8 @@ def test_default(self, app_utils, _session_permanent, def test_lifetime(self, app_utils, _session_permanent, _session_refresh_each_request): + pytest.skip("TODO FIX") + app = app_utils.create_app( { "SESSION_TYPE": "sqlalchemy",