From 3b0d75d3a9cc1fdfdb77b31dc46a803a32bf5021 Mon Sep 17 00:00:00 2001 From: Mira Weller Date: Fri, 4 Apr 2025 18:44:35 +0200 Subject: [PATCH] reformat --- src/pretix/base/datasync/utils.py | 22 ++++++++++++++++++++++ src/tests/base/test_datasync.py | 13 ++++++++----- 2 files changed, 30 insertions(+), 5 deletions(-) diff --git a/src/pretix/base/datasync/utils.py b/src/pretix/base/datasync/utils.py index 2ce6af4a72..f050677fdd 100644 --- a/src/pretix/base/datasync/utils.py +++ b/src/pretix/base/datasync/utils.py @@ -1,3 +1,25 @@ +# +# This file is part of pretix (Community Edition). +# +# Copyright (C) 2014-2020 Raphael Michel and contributors +# Copyright (C) 2020-2021 rami.io GmbH and contributors +# +# This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General +# Public License as published by the Free Software Foundation in version 3 of the License. +# +# ADDITIONAL TERMS APPLY: Pursuant to Section 7 of the GNU Affero General Public License, additional terms are +# applicable granting you additional permissions and placing additional restrictions on your usage of this software. +# Please refer to the pretix LICENSE file to obtain the full terms applicable to this work. If you did not receive +# this file, see . +# +# This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied +# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more +# details. +# +# You should have received a copy of the GNU Affero General Public License along with this program. If not, see +# . +# + from typing import List, Tuple from pretix.base.datasync.datasync import ( diff --git a/src/tests/base/test_datasync.py b/src/tests/base/test_datasync.py index bb827e77ff..4bfb750e24 100644 --- a/src/tests/base/test_datasync.py +++ b/src/tests/base/test_datasync.py @@ -28,10 +28,12 @@ import pytest from django.utils.timezone import now from django_scopes import scope -from pretix.base.datasync.datasync import OutboundSyncProvider, StaticMapping, MODE_OVERWRITE, MODE_SET_IF_EMPTY, \ - MODE_SET_IF_NEW, MODE_APPEND_LIST, sync_all, sync_targets +from pretix.base.datasync.datasync import ( + MODE_APPEND_LIST, MODE_OVERWRITE, MODE_SET_IF_EMPTY, MODE_SET_IF_NEW, + OutboundSyncProvider, StaticMapping, sync_all, sync_targets, +) from pretix.base.datasync.utils import assign_properties -from pretix.base.models import Organizer, Event, Order, Item, OrderPosition +from pretix.base.models import Event, Item, Order, OrderPosition, Organizer @pytest.fixture(scope='function') @@ -280,6 +282,7 @@ AssociationMapping = namedtuple('AssociationMapping', ( 'via_mapping_pk' )) + class OrderAndTicketAssociationSync(OutboundSyncProvider): identifier = "example2" fake_api_client = None @@ -505,8 +508,8 @@ def test_assign_properties(): [("colors", "red", MODE_APPEND_LIST)], {"colors": "green;blue"}, is_new=False ) == {"colors": "green;blue;red"} assert assign_properties( - [("colors", "red", MODE_APPEND_LIST)], {"colors": ["green","blue"]}, is_new=False, list_sep=None + [("colors", "red", MODE_APPEND_LIST)], {"colors": ["green", "blue"]}, is_new=False, list_sep=None ) == {"colors": ["green", "blue", "red"]} assert assign_properties( - [("colors", "green", MODE_APPEND_LIST)], {"colors": ["green","blue"]}, is_new=False, list_sep=None + [("colors", "green", MODE_APPEND_LIST)], {"colors": ["green", "blue"]}, is_new=False, list_sep=None ) == {}