|
@ -30,7 +30,7 @@ class SendAlertsTestCase(BaseTestCase): |
|
|
|
|
|
|
|
|
def test_it_sends_report(self): |
|
|
def test_it_sends_report(self): |
|
|
cmd = Command() |
|
|
cmd = Command() |
|
|
cmd.stdout = Mock() # silence output to stdout |
|
|
|
|
|
|
|
|
cmd.stdout = Mock() # silence output to stdout |
|
|
cmd.pause = Mock() # don't pause for 1s |
|
|
cmd.pause = Mock() # don't pause for 1s |
|
|
|
|
|
|
|
|
found = cmd.handle_one_monthly_report() |
|
|
found = cmd.handle_one_monthly_report() |
|
@ -40,6 +40,9 @@ class SendAlertsTestCase(BaseTestCase): |
|
|
self.assertTrue(self.profile.next_report_date > now()) |
|
|
self.assertTrue(self.profile.next_report_date > now()) |
|
|
self.assertEqual(len(mail.outbox), 1) |
|
|
self.assertEqual(len(mail.outbox), 1) |
|
|
|
|
|
|
|
|
|
|
|
email = mail.outbox[0] |
|
|
|
|
|
self.assertTrue("List-Unsubscribe" in email.extra_headers) |
|
|
|
|
|
|
|
|
def test_it_obeys_next_report_date(self): |
|
|
def test_it_obeys_next_report_date(self): |
|
|
self.profile.next_report_date = now() + td(days=1) |
|
|
self.profile.next_report_date = now() + td(days=1) |
|
|
self.profile.save() |
|
|
self.profile.save() |
|
|