From 2179689c5553cbd7c5a2282558789162ceecdb17 Mon Sep 17 00:00:00 2001 From: John Labbate Date: Wed, 6 Mar 2024 08:49:27 -0500 Subject: [PATCH] Mock email sending in a different way. --- training/tests/test_api_gspc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/training/tests/test_api_gspc.py b/training/tests/test_api_gspc.py index 96b9caf4..658b3ef4 100644 --- a/training/tests/test_api_gspc.py +++ b/training/tests/test_api_gspc.py @@ -87,11 +87,11 @@ def test_gspc_invite_parses_invalid_emails(self, send_gspc_invite_email, goodJWT @patch('training.config.settings', 'JWT_SECRET', 'super_secret') @patch('training.api.api_v1.gspc.send_gspc_invite_email') - def test_gspc_invite_sends_emails_to_valid_emails(self, goodJWT, standard_payload, fake_gspc_invite_repo): + def test_gspc_invite_sends_emails_to_valid_emails(self, send_gspc_invite_email, goodJWT, standard_payload, fake_gspc_invite_repo): '''Given 2 valid emails send 2 invite emails''' - with patch('training.api.api_v1.gspc.send_gspc_invite_email') as mock_send_email: - post_gspc_invite(standard_payload, goodJWT) - assert mock_send_email.call_count == 2 + + post_gspc_invite(standard_payload, goodJWT) + assert send_gspc_invite_email.call_count == 2 @patch('training.config.settings', 'JWT_SECRET', 'super_secret') @patch('training.api.api_v1.gspc.send_gspc_invite_email')