From ec23a329c5043cdeca31116c739d82fdcdb8efa9 Mon Sep 17 00:00:00 2001 From: Philip Bauer Date: Wed, 28 Feb 2024 11:03:22 +0100 Subject: [PATCH] fix test for 4.3 --- src/collective/exportimport/tests/test_export.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/collective/exportimport/tests/test_export.py b/src/collective/exportimport/tests/test_export.py index cb86f844..831f3e7d 100644 --- a/src/collective/exportimport/tests/test_export.py +++ b/src/collective/exportimport/tests/test_export.py @@ -321,10 +321,14 @@ def test_export_indirect_members(self): data = json.loads(contents) self.assertIn("groups", data.keys()) self.assertIn("members", data.keys()) - member_data = data["members"][0] - self.assertEqual(member_data["username"], TEST_USER_ID) - # Only direct membership is exported - self.assertEqual(member_data["groups"], ["Direct"]) + members = data["members"] + membernames = [member["username"] for member in members] + self.assertIn(TEST_USER_ID, membernames) + for member in members: + if member["username"] == TEST_USER_ID: + self.assertEqual(member["username"], TEST_USER_ID) + # Only direct membership is exported + self.assertEqual(member["groups"], ["Direct"]) def test_export_defaultpages_empty(self): browser = self.open_page("@@export_defaultpages")