def test_form_sent_thirty_one_days_ago(self, last_sub_time):
     # last submissions only looks 30 days into past
     last_sub_time.return_value = {}
     indicator = LSSubmissionPerformanceIndicator(self.domain, self.ls)
     messages = indicator.get_messages(language_code='en')
     self.assertEqual(len(messages), 1)
     message = messages[0]
     self.assertTrue('one month' in message)
     self.assertTrue('AWC1' in message)
 def test_form_sent_thirty_days_ago(self, last_sub_time):
     last_sub_time.return_value = {
         self.aww.get_id: self.today - timedelta(days=30)
     }
     indicator = LSSubmissionPerformanceIndicator(self.domain, self.ls)
     messages = indicator.get_messages(language_code='en')
     self.assertEqual(len(messages), 1)
     message = messages[0]
     self.assertTrue('one week' in message)
     self.assertTrue('AWC1' in message)
 def test_multiple_awc_eight_days_ago(self, last_sub_time):
     aww_2 = self._make_user('aww_2', self.locs['AWC2'])
     self.addCleanup(aww_2.delete)
     last_sub_time.return_value = {
         self.aww.get_id: self.today - timedelta(days=8),
         aww_2.get_id: self.today - timedelta(days=8)
     }
     indicator = LSSubmissionPerformanceIndicator(self.domain, self.ls)
     messages = indicator.get_messages(language_code='en')
     self.assertEqual(len(messages), 1)
     message = messages[0]
     self.assertTrue('one week' in message)
     self.assertTrue('AWC1' in message)
     self.assertTrue('AWC2' in message)
 def test_form_sent_seven_days_ago(self, last_sub_time):
     last_sub_time.return_value = {
         self.aww.get_id: self.today - timedelta(days=7)
     }
     indicator = LSSubmissionPerformanceIndicator(self.domain, self.ls)
     self.assertEqual(len(indicator.get_messages(language_code='en')), 0)
 def test_form_sent_today(self, last_sub_time):
     last_sub_time.return_value = {self.aww.get_id: self.today}
     indicator = LSSubmissionPerformanceIndicator(self.domain, self.ls)
     self.assertEqual(len(indicator.get_messages()), 0)