@mock.patch('transcoder.tasks.transcode', mock.Mock())
def test_send_email_to_customer_after_transcode_process_ending(self, mock1):
    with mock.patch('post_office.mailgun.requests') as mocked_requests:
        response = self.client.post(reverse('request_shoutout:fulfill'), self.request_data, format='multipart')
    shoutout = ShoutoutVideo.objects.first()
    expected_calls = [mock.call(auth=('api', os.environ['MAILGUN_API_KEY']), url=os.environ['MAILGUN_API_URL'], data={'from': os.environ['CONTACT_EMAIL'], 'to': 'MJ <example@example.com>', 'subject': 'Seu viggio para Peter está pronto', 'template': 'notify-customer-that-his-viggio-is-ready', 'v:order_is_to': 'Peter', 'v:customer_name': 'MJ', 'v:talent_name': 'Nome Sobrenome', 'v:shoutout_absolute_url': f"{os.environ['SITE_URL']}v/{shoutout.hash_id}"})]
    self.assertEqual(response.status_code, status.HTTP_201_CREATED)
    self.assertEqual(mocked_requests.post.mock_calls, expected_calls)
@mock.patch('transcoder.tasks.transcode', mock.Mock())
def test_send_email_to_customer_after_transcode_process_ending(self, mock1):
    with mock.patch('post_office.mailgun.requests') as mocked_requests:
        response = self.client.post(reverse('request_shoutout:fulfill'), self.request_data, format='multipart')
    shoutout = ShoutoutVideo.objects.first()
    expected_calls = [mock.call(auth=('api', os.environ['MAILGUN_API_KEY']), url=os.environ['MAILGUN_API_URL'], data={'from': os.environ['CONTACT_EMAIL'], 'to': 'MJ <example@example.com>', 'subject': 'Seu viggio para Peter está pronto', 'template': 'notify-customer-that-his-viggio-is-ready', 'v:order_is_to': 'Peter', 'v:customer_name': 'MJ', 'v:talent_name': 'Nome Sobrenome', 'v:shoutout_absolute_url': f"{os.environ['SITE_URL']}v/{shoutout.hash_id}"})]
    self.assertEqual(response.status_code, status.HTTP_201_CREATED)
    self.assertEqual(mocked_requests.post.mock_calls, expected_calls)