From cd5481dc205b974dfda0f8cc2734a0b03c4c2ef2 Mon Sep 17 00:00:00 2001 From: nenenko Date: Tue, 16 Jul 2024 15:11:16 +0200 Subject: [PATCH] fix: parent group update fixed; logger messages updated --- tests/test_restore.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/test_restore.py b/tests/test_restore.py index 3fdc2c5..f40836d 100644 --- a/tests/test_restore.py +++ b/tests/test_restore.py @@ -3,6 +3,7 @@ import logging import os import tempfile +import json from pathlib import Path from unittest import mock @@ -408,20 +409,30 @@ def test_load_user_data_filters(): user_data_filters_expected = { "userDataFilters": [ { - "id": "datafilter4", + "id": "datafilter2", "maql": '{label/campaign_channels.category} = "1"', "title": "Status filter", "user": {"id": "5c867a8a-12af-45bf-8d85-c7d16bedebd1", "type": "user"}, }, { - "id": "datafilter2", + "id": "datafilter4", "maql": '{label/campaign_channels.category} = "1"', "title": "Status filter", "user": {"id": "5c867a8a-12af-45bf-8d85-c7d16bedebd1", "type": "user"}, }, ] } - assert user_data_filters == user_data_filters_expected + + # Convert both the expected and actual filter lists to sorted lists of their JSON string representations + sorted_user_data_filters = sorted( + json.dumps(d, sort_keys=True) for d in user_data_filters["userDataFilters"] + ) + sorted_user_data_filters_expected = sorted( + json.dumps(d, sort_keys=True) + for d in user_data_filters_expected["userDataFilters"] + ) + + assert sorted_user_data_filters == sorted_user_data_filters_expected @mock.patch("scripts.restore.create_client")