Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
snyaggarwal committed Aug 28, 2023
1 parent d38f1d4 commit e711b46
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/common/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1043,14 +1043,16 @@ def test_monthly_usage_report(self, email_message_mock):
email_message_mock.assert_called_once()
email_message_instance_mock.send.assert_called_once()
email_message_instance_mock.attach.assert_called_once_with(ANY, ANY, 'text/csv')
self.assertTrue('_resource_report_' in email_message_instance_mock.attach.call_args[0][0])
self.assertTrue('.csv' in email_message_instance_mock.attach.call_args[0][0])
self.assertTrue(b'Resources Created' in email_message_instance_mock.attach.call_args[0][1])

self.assertEqual(res, 1)
call_args = email_message_mock.call_args[1]
self.assertTrue("Monthly Resources Report" in call_args['subject'])
self.assertEqual(call_args['to'], ['reports@openconceptlab.org'])
self.assertTrue('Please find attached resources report of' in call_args['body'])
self.assertTrue('for the period of' in call_args['body'])
self.assertEqual(email_message_instance_mock.content_subtype, 'html')


class PostgresQLTest(OCLTestCase):
Expand Down

0 comments on commit e711b46

Please sign in to comment.