Пример #1
0
 def test_send_notice_no_recipients(self):
     utils.create_service_event(is_review_required=True)
     self.recipients.groups.clear()
     tasks.send_serviceeventreview_notice(self.notice.pk)
     self.notice.refresh_from_db()
     assert self.notice.last_sent is None
     assert len(mail.outbox) == 0
Пример #2
0
 def test_send_notice_empty(self):
     self.notice.send_empty = True
     self.notice.save()
     now = timezone.now()
     tasks.send_serviceeventreview_notice(self.notice.pk)
     self.notice.refresh_from_db()
     assert self.notice.last_sent >= now
     assert "QATrack+ Unreviewed Service Event Notice:" in mail.outbox[
         0].subject
Пример #3
0
 def test_send_notice(self):
     self.se1 = utils.create_service_event(unit_service_area=self.usa1)
     self.se1.is_review_required = True
     self.se1.save()
     now = timezone.now()
     tasks.send_serviceeventreview_notice(self.notice.pk)
     self.notice.refresh_from_db()
     assert self.notice.last_sent >= now
     assert "QATrack+ Unreviewed Service Event Notice:" in mail.outbox[
         0].subject
Пример #4
0
 def test_send_notice_non_existent(self):
     tasks.send_serviceeventreview_notice(self.notice.pk + 1)
     self.notice.refresh_from_db()
     assert self.notice.last_sent is None
     assert len(mail.outbox) == 0
Пример #5
0
 def test_send_notice_not_empty(self):
     tasks.send_serviceeventreview_notice(self.notice.pk)
     self.notice.refresh_from_db()
     assert len(mail.outbox) == 0