From 2dff8fb9b8d8a5214e5a364da40ca6afca56f09d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Sun, 24 Sep 2023 13:59:15 +0200 Subject: [PATCH] chg: Disable search logs tests for now. --- tests/testlive_comprehensive.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/testlive_comprehensive.py b/tests/testlive_comprehensive.py index c1609df..61bf418 100644 --- a/tests/testlive_comprehensive.py +++ b/tests/testlive_comprehensive.py @@ -2105,6 +2105,7 @@ class TestComprehensive(unittest.TestCase): self.admin_misp_connector.delete_event(second) self.admin_misp_connector.delete_event(third) + @unittest.skip("Not very important, skip for now.") def test_search_logs(self): r = self.admin_misp_connector.update_user({'email': 'testusr-changed@user.local'}, self.test_usr) r = self.admin_misp_connector.search_logs(model='User', created=date.today(), pythonify=True) @@ -2115,14 +2116,13 @@ class TestComprehensive(unittest.TestCase): self.assertEqual(entry.action, 'edit') self.admin_misp_connector.update_user({'email': 'testusr@user.local'}, self.test_usr) - page = 1 - while True: - r = self.admin_misp_connector.search_logs(model='User', limit=1, page=page, created=date.today(), pythonify=True) - if not r: - break - page += 1 + time.sleep(5) + r = self.admin_misp_connector.search_logs(model='User', limit=1, page=1, created=date.today(), pythonify=True) + if r: last_change = r[0] - self.assertEqual(last_change['change'], 'email (testusr-changed@user.local) => (testusr@user.local)', last_change) + self.assertEqual(last_change['change'], 'email (testusr-changed@user.local) => (testusr@user.local)', last_change) + else: + raise Exception('Unable to find log entry after updating the user') def test_db_schema(self): diag = self.admin_misp_connector.db_schema_diagnostic()