def test_temporary_reminder_office(self): '''Tests if the office is reminded of a temporary vote.''' threads = self.threads.filter(receiver=self.bob) thread_count = threads.count() send_reminder_messages(today=self.vote_b2.published_at.date() + timedelta(days=240)) self.assertEqual(thread_count + 1, threads.count())
def test_reminder_office(self): '''Tests that messages get sent to office before the deadline''' threads = self.threads.filter(receiver=self.bob) thread_count = threads.count() send_reminder_messages(today=self.vote.valid_until.date() - timedelta(days=7)) self.assertEqual(thread_count + 1, threads.count())
def test_reminder_submitter(self): '''Tests if the submitter of a study gets a reminder message.''' threads = self.threads.filter(receiver=self.alice) thread_count = threads.count() send_reminder_messages(today=self.vote.valid_until.date() - timedelta(days=21)) self.assertEqual(thread_count + 1, threads.count())
def test_expiry(self): '''Tests that reminder messages actually get sent to submission participants.''' alice_threads = self.threads.filter(receiver=self.alice) bob_threads = self.threads.filter(receiver=self.bob) alice_thread_count = alice_threads.count() bob_thread_count = bob_threads.count() send_reminder_messages(today=self.vote.valid_until.date() + timedelta(days=1)) self.assertEqual(alice_thread_count + 1, alice_threads.count()) self.assertEqual(bob_thread_count + 1, bob_threads.count())