From f54b07e21ed5c85e4c15c5c57be4c03b4b5c1e2a Mon Sep 17 00:00:00 2001 From: Fritz Brand Date: Thu, 24 Oct 2024 08:59:02 +0200 Subject: [PATCH] Updates after feedback --- Dockerfile | 3 ++- eventstore/tests/test_views.py | 12 ++++++------ eventstore/tests/test_whatsapp_actions.py | 2 +- scripts/growgreat_extract/msisdn_from_details.py | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index e8717e15..34d55e67 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,10 @@ FROM ghcr.io/praekeltfoundation/docker-django-bootstrap-nw:py3.9-bullseye -RUN pip install poetry==1.8.3 ENV DJANGO_SETTINGS_MODULE "ndoh_hub.settings" COPY . /app + +RUN pip install poetry RUN poetry config virtualenvs.create false \ && poetry install --no-dev --no-interaction --no-ansi --no-cache diff --git a/eventstore/tests/test_views.py b/eventstore/tests/test_views.py index 58f7c887..b1e46ec4 100644 --- a/eventstore/tests/test_views.py +++ b/eventstore/tests/test_views.py @@ -1289,9 +1289,9 @@ def test_successful_inbound_messages_request(self, mock_handle_inbound): datetime.datetime(2018, 2, 15, 11, 38, 20, tzinfo=UTC), ), ) - (self.assertEqual(messages.id, "9e12d04c-af25-40b6-aa4f-57c72e8e3f91"),) - (self.assertEqual(messages.type, "image"),) - (self.assertEqual(messages.message_direction, Message.INBOUND),) + self.assertEqual(messages.id, "9e12d04c-af25-40b6-aa4f-57c72e8e3f91") + self.assertEqual(messages.type, "image") + self.assertEqual(messages.message_direction, Message.INBOUND) ( self.assertEqual( messages.data, @@ -1395,9 +1395,9 @@ def test_successful_outbound_messages_request(self, mock_handle_outbound): self.assertEqual(response.status_code, status.HTTP_201_CREATED) [messages] = Message.objects.all() self.assertEqual(str(messages.contact_id), "whatsapp-id") - (self.assertEqual(messages.id, "message-id"),) - (self.assertEqual(messages.type, "text"),) - (self.assertEqual(messages.message_direction, Message.OUTBOUND),) + self.assertEqual(messages.id, "message-id") + self.assertEqual(messages.type, "text") + self.assertEqual(messages.message_direction, Message.OUTBOUND) ( self.assertEqual( messages.data, diff --git a/eventstore/tests/test_whatsapp_actions.py b/eventstore/tests/test_whatsapp_actions.py index ca6eb3a9..8de4f78f 100644 --- a/eventstore/tests/test_whatsapp_actions.py +++ b/eventstore/tests/test_whatsapp_actions.py @@ -201,7 +201,7 @@ def test_handle_edd_label_disabled(self): with patch("eventstore.whatsapp_actions.handle_edd_message") as handle: handle_inbound(message) - _var = handle.assert_not_called + handle.assert_not_called() class UpdateRapidproAlertOptoutTests(DjangoTestCase): diff --git a/scripts/growgreat_extract/msisdn_from_details.py b/scripts/growgreat_extract/msisdn_from_details.py index afd9c038..ab80f934 100644 --- a/scripts/growgreat_extract/msisdn_from_details.py +++ b/scripts/growgreat_extract/msisdn_from_details.py @@ -4,7 +4,7 @@ def get_msisdn(details): last = None - for addr, _addr_dets in details.get("addresses", {}).get("msisdn", {}).items(): + for addr in details.get("addresses", {}).get("msisdn", {}): if details.get("default") is True: return addr if details.get("optedout") is not True: