Beispiel #1
0
 def test_send_mail_for_educational_information_update(self, mock_send_messages):
     add_message_template_html_education_update()
     add_message_template_txt_education_update()
     send_mail.send_mail_for_educational_information_update([self.person_1], [self.learning_unit_year])
     args = mock_send_messages.call_args[0][0]
     self.assertEqual(len(args.get('receivers')), 1)
     self.assertEqual([self.learning_unit_year], args.get('template_base_data').get('learning_unit_years'))
Beispiel #2
0
 def test_send_mail_for_educational_information_update(self, mock_class):
     add_message_template_html_education_update()
     add_message_template_txt_education_update()
     mock_class.send.return_value = None
     self.assertIsInstance(mock_class, EmailMultiAlternatives)
     send_mail.send_mail_for_educational_information_update([self.person_1], [self.learning_unit_year])
     call_args = mock_class.call_args
     recipients = call_args[0][3]
     self.assertEqual(len(recipients), 1)
Beispiel #3
0
def _send_email_to_responsibles(responsible_person_ids):
    for a_responsible_person_id in responsible_person_ids:
        a_person = get_object_or_404(Person,
                                     pk=a_responsible_person_id.get('person'))
        send_mail_for_educational_information_update(
            [a_person], a_responsible_person_id.get('learning_unit_years'))