def test_it_sends_nag(self): cmd = Command(stdout=Mock()) cmd.pause = Mock() # don't pause for 1s found = cmd.handle_one_nag() self.assertTrue(found) self.profile.refresh_from_db() self.assertTrue(self.profile.next_nag_date > now()) self.assertEqual(len(mail.outbox), 1)
def test_it_sends_nag(self): cmd = Command(stdout=Mock()) cmd.pause = Mock() # don't pause for 1s found = cmd.handle_one_nag() self.assertTrue(found) self.profile.refresh_from_db() self.assertTrue(self.profile.next_nag_date > now()) self.assertEqual(len(mail.outbox), 1) email = mail.outbox[0] html = email.alternatives[0][0] self.assertNotIn(str(self.check.code), email.body) self.assertNotIn(str(self.check.code), html)