"""Tests for AWS SES utils.""" from unittest.mock import patch from collaborator.utils import ses @patch.object(ses, "boto3") def test_send_email(boto3_mock): """Test sending an email.""" ses.send_email( "paulo@theorchard.com", "donotreply@theorchard.com", "subject", "message" ) boto3_mock.client().send_email.assert_any_call( Source="donotreply@theorchard.com", Destination={ "ToAddresses": [ "paulo@theorchard.com", ] }, Message={ "Subject": {"Data": "subject", "Charset": "utf-8"}, "Body": {"Html": {"Data": "message", "Charset": "utf-8"}}, }, ReplyToAddresses=["donotreply@theorchard.com"], )