Skip to content

Commit

Permalink
Fixes to linting
Browse files Browse the repository at this point in the history
  • Loading branch information
seijihg committed Feb 6, 2024
1 parent 1dbfc41 commit a60e8c7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion mail/libraries/routing_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def _collect_and_send(mail: Mail):

if message_to_send_dto:
if message_to_send_dto.receiver != SourceEnum.LITE and message_to_send_dto.subject:
send_email_task(mail_id=mail["id"], message=message_to_send_dto)
send_email_task(mail_id=mail.id, message=message_to_send_dto)
update_mail(mail, message_to_send_dto)

logger.info(
Expand Down
1 change: 0 additions & 1 deletion mail/tasks.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import time

from hashlib import md5
from smtplib import SMTPException
from contextlib import contextmanager
from django.core.cache import cache
Expand Down
6 changes: 3 additions & 3 deletions mail/tests/test_resend_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class LITEHMRCResendEmailTests(LiteHMRCTestClient):
@mock.patch("mail.libraries.routing_controller.get_spire_to_dit_mailserver")
@mock.patch("mail.libraries.routing_controller.get_hmrc_to_dit_mailserver")
@mock.patch("mail.libraries.routing_controller.send")
@mock.patch("mail.libraries.routing_controller.send_email_task")
@mock.patch("mail.libraries.routing_controller.get_email_message_dtos")
def test_resend_licence_data_mail_to_hmrc(
self,
Expand Down Expand Up @@ -66,7 +66,7 @@ def test_resend_licence_data_mail_to_hmrc(

@mock.patch("mail.libraries.routing_controller.get_spire_to_dit_mailserver")
@mock.patch("mail.libraries.routing_controller.get_hmrc_to_dit_mailserver")
@mock.patch("mail.libraries.routing_controller.send")
@mock.patch("mail.libraries.routing_controller.send_email_task")
@mock.patch("mail.libraries.routing_controller.get_email_message_dtos")
def test_resend_licence_reply_mail_to_spire(
self,
Expand Down Expand Up @@ -133,7 +133,7 @@ def test_resend_licence_reply_mail_to_spire(

@mock.patch("mail.libraries.routing_controller.get_spire_to_dit_mailserver")
@mock.patch("mail.libraries.routing_controller.get_hmrc_to_dit_mailserver")
@mock.patch("mail.libraries.routing_controller.send")
@mock.patch("mail.libraries.routing_controller.send_email_task")
@mock.patch("mail.libraries.routing_controller.get_email_message_dtos")
def test_resend_usage_data_mail_to_spire(
self,
Expand Down
10 changes: 5 additions & 5 deletions mail/tests/test_select_email_for_sending.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def test_email_selected_if_no_spire_data(self):

@mock.patch("mail.libraries.routing_controller.get_spire_to_dit_mailserver")
@mock.patch("mail.libraries.routing_controller.get_hmrc_to_dit_mailserver")
@mock.patch("mail.libraries.routing_controller.send")
@mock.patch("mail.libraries.routing_controller.send_email_task")
@mock.patch("mail.libraries.routing_controller.get_email_message_dtos")
def test_case1_sending_of_pending_licencedata_mails(
self,
Expand Down Expand Up @@ -164,7 +164,7 @@ def test_case1_sending_of_pending_licencedata_mails(

@mock.patch("mail.libraries.routing_controller.get_spire_to_dit_mailserver")
@mock.patch("mail.libraries.routing_controller.get_hmrc_to_dit_mailserver")
@mock.patch("mail.libraries.routing_controller.send")
@mock.patch("mail.libraries.routing_controller.send_email_task")
@mock.patch("mail.libraries.routing_controller.get_email_message_dtos")
def test_case2_sending_of_pending_usagedata_mails(
self,
Expand Down Expand Up @@ -229,7 +229,7 @@ def test_case2_sending_of_pending_usagedata_mails(

@mock.patch("mail.libraries.routing_controller.get_spire_to_dit_mailserver")
@mock.patch("mail.libraries.routing_controller.get_hmrc_to_dit_mailserver")
@mock.patch("mail.libraries.routing_controller.send")
@mock.patch("mail.libraries.routing_controller.send_email_task")
@mock.patch("mail.libraries.routing_controller.get_email_message_dtos")
def test_case3_sending_of_pending_licencedata_and_usagedata_mails_1(
self,
Expand Down Expand Up @@ -319,7 +319,7 @@ def test_case3_sending_of_pending_licencedata_and_usagedata_mails_1(

@mock.patch("mail.libraries.routing_controller.get_spire_to_dit_mailserver")
@mock.patch("mail.libraries.routing_controller.get_hmrc_to_dit_mailserver")
@mock.patch("mail.libraries.routing_controller.send")
@mock.patch("mail.libraries.routing_controller.send_email_task")
@mock.patch("mail.libraries.routing_controller.get_email_message_dtos")
def test_case3_sending_of_pending_licencedata_and_usagedata_mails_2(
self,
Expand Down Expand Up @@ -395,7 +395,7 @@ def test_case3_sending_of_pending_licencedata_and_usagedata_mails_2(

@mock.patch("mail.libraries.routing_controller.get_spire_to_dit_mailserver")
@mock.patch("mail.libraries.routing_controller.get_hmrc_to_dit_mailserver")
@mock.patch("mail.libraries.routing_controller.send")
@mock.patch("mail.libraries.routing_controller.send_email_task")
@mock.patch("mail.libraries.routing_controller.get_email_message_dtos")
def test_case4_sending_of_pending_licencedata_when_waiting_for_reply(
self,
Expand Down

0 comments on commit a60e8c7

Please sign in to comment.