Пример #1
0
 def test_send_notice_no_recipients(self):
     utils.create_service_event_schedule()
     self.recipients.groups.clear()
     self.notice.send_empty = True
     self.notice.save()
     tasks.send_scheduling_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_send_empty(self):
     now = timezone.now()
     self.notice.send_empty = True
     self.notice.save()
     tasks.send_scheduling_notice(self.notice.pk)
     self.notice.refresh_from_db()
     assert self.notice.last_sent >= now
     assert "QATrack+ Service Event Scheduling Notice:" in mail.outbox[
         0].subject
Пример #3
0
 def test_send_notice_non_existent(self):
     tasks.send_scheduling_notice(self.notice.pk + 1)
     self.notice.refresh_from_db()
     assert self.notice.last_sent is None
     assert len(mail.outbox) == 0
Пример #4
0
 def test_send_notice_no_send_empty(self):
     tasks.send_scheduling_notice(self.notice.pk)
     self.notice.refresh_from_db()
     assert len(mail.outbox) == 0