예제 #1
0
 def test_send_notice_no_recipients(self):
     utils.create_test_list_instance()
     self.recipients.groups.clear()
     tasks.send_qcreview_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_qcreview_notice(self.notice.pk)
     self.notice.refresh_from_db()
     assert self.notice.last_sent >= now
     assert "QATrack+ Unreviewed QC Notice:" in mail.outbox[0].subject
예제 #3
0
 def test_send_notice(self):
     self.tli1 = utils.create_test_list_instance(
         unit_test_collection=self.utc1)
     self.tli1.all_reviewed = False
     self.tli1.save()
     now = timezone.now()
     tasks.send_qcreview_notice(self.notice.pk)
     self.notice.refresh_from_db()
     assert self.notice.last_sent >= now
     assert "QATrack+ Unreviewed QC Notice:" in mail.outbox[0].subject
예제 #4
0
 def test_send_notice_non_existent(self):
     tasks.send_qcreview_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_qcreview_notice(self.notice.pk)
     self.notice.refresh_from_db()
     assert len(mail.outbox) == 0