Skip to content

Commit

Permalink
Mock email sending in a different way.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-labbate committed Mar 6, 2024
1 parent fbf456e commit 2179689
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions training/tests/test_api_gspc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 2179689

Please sign in to comment.