From b806b8406b267e2ea2224bd4b58813e0c721ad87 Mon Sep 17 00:00:00 2001 From: GabrielMeyer Date: Tue, 29 Oct 2019 15:05:52 +0100 Subject: [PATCH] Fixes python3.7 tests --- openslides/agenda/signals.py | 4 ++-- openslides/global_settings.py | 4 ++-- openslides/motions/models.py | 5 ++++- openslides/utils/cache.py | 5 ++++- openslides/utils/projector.py | 2 +- openslides/utils/websocket.py | 2 +- tests/integration/motions/test_viewset.py | 2 +- 7 files changed, 15 insertions(+), 9 deletions(-) diff --git a/openslides/agenda/signals.py b/openslides/agenda/signals.py index 59b8d21d8..ed876ea0d 100644 --- a/openslides/agenda/signals.py +++ b/openslides/agenda/signals.py @@ -22,8 +22,8 @@ def listen_to_related_object_post_save(sender, instance, created, **kwargs): skip_autoupdate in the agenda_item_update_information container. """ instance_inform_changed_data = ( - False - ) # evaluates, if the related_object has to be send again. + False # evaluates, if the related_object has to be send again. + ) # This is the case, if it was newly created and the autoupdate is not skipped with # agenda_item_skip_autoupdate or List_of_speakers_skip_autoupdate. If the related_object is # related to agenda items and list of speakers, the autoupdate is skipped, if one of the given diff --git a/openslides/global_settings.py b/openslides/global_settings.py index d565c022f..bc1a201cc 100644 --- a/openslides/global_settings.py +++ b/openslides/global_settings.py @@ -54,8 +54,8 @@ TEMPLATES = [ EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" EMAIL_TIMEOUT = ( - 5 -) # Timeout in seconds for blocking operations like the connection attempt + 5 # Timeout in seconds for blocking operations like the connection attempt +) # Internationalization # https://docs.djangoproject.com/en/1.10/topics/i18n/ diff --git a/openslides/motions/models.py b/openslides/motions/models.py index 32b82381a..7b619c7ec 100644 --- a/openslides/motions/models.py +++ b/openslides/motions/models.py @@ -308,7 +308,10 @@ class Motion(RESTModelMixin, AgendaItemWithListOfSpeakersMixin, models.Model): # Identifier is already used. if hasattr(self, "_identifier_prefix"): # Calculate a new one and try again. - self.identifier_number, self.identifier = self.increment_identifier_number( + ( + self.identifier_number, + self.identifier, + ) = self.increment_identifier_number( self.identifier_number, self._identifier_prefix ) else: diff --git a/openslides/utils/cache.py b/openslides/utils/cache.py index 23ce7e047..f6d7e4ee6 100644 --- a/openslides/utils/cache.py +++ b/openslides/utils/cache.py @@ -303,7 +303,10 @@ class ElementCache: f"change_id {change_id} is lower then the lowest change_id in redis {lowest_change_id}." ) - raw_changed_elements, deleted_elements = await self.cache_provider.get_data_since( + ( + raw_changed_elements, + deleted_elements, + ) = await self.cache_provider.get_data_since( change_id, max_change_id=max_change_id ) changed_elements = { diff --git a/openslides/utils/projector.py b/openslides/utils/projector.py index 321dcc855..98ba26702 100644 --- a/openslides/utils/projector.py +++ b/openslides/utils/projector.py @@ -33,7 +33,7 @@ def register_projector_slide(name: str, slide: ProjectorSlide) -> None: async def get_projector_data( - projector_ids: List[int] = None + projector_ids: List[int] = None, ) -> Dict[int, List[Dict[str, Any]]]: """ Calculates and returns the data for one or all projectors. diff --git a/openslides/utils/websocket.py b/openslides/utils/websocket.py index 717726705..b001b2dc9 100644 --- a/openslides/utils/websocket.py +++ b/openslides/utils/websocket.py @@ -202,7 +202,7 @@ Saves all websocket client message object ordered by there identifier. def register_client_message( - websocket_client_message: BaseWebsocketClientMessage + websocket_client_message: BaseWebsocketClientMessage, ) -> None: """ Registers one websocket client message class. diff --git a/tests/integration/motions/test_viewset.py b/tests/integration/motions/test_viewset.py index a8c86f1ec..e3e48c63c 100644 --- a/tests/integration/motions/test_viewset.py +++ b/tests/integration/motions/test_viewset.py @@ -519,7 +519,7 @@ class RetrieveMotion(TestCase): self.assertEqual(response.status_code, status.HTTP_200_OK) def test_user_without_can_see_user_permission_to_see_motion_and_submitter_data( - self + self, ): admin = get_user_model().objects.get(username="admin") Submitter.objects.add(admin, self.motion)