Exemple #1
0
    def test_hit_trans_deadline_notifications(self):
        """
        Check whether notifications are sent to the correct people whenever a
        translation period is over.
        """
        timestamp = datetime.datetime.now() - datetime.timedelta(hours=1)
        self.release.develfreeze_date = timestamp
        self.release.notifications.before_trans_deadline = True
        self.release.notifications.save()
        self.release.save()

        notify_translation_deadline()

        # Sorted mails list
        mails = key_sort(mail.outbox, 'to')

        self.assertEqual(len(mails), 5)
        self.assertEqual(
            mails[0].subject,
            self._gen_assert_msg('[localhost] Release has '
                                 'hit the translation deadline: Release1'))

        self.assertEqual(mails[0].to, ['maintainer3@localhost'])
        self.assertEqual(mails[1].to, ['maintainer@localhost'])
        self.assertEqual(mails[2].to, ['reviewer@localhost'])
        self.assertEqual(mails[3].to, ['team_coordinator@localhost'])
        self.assertEqual(mails[4].to, ['team_member@localhost'])
Exemple #2
0
    def test_hit_trans_deadline_notifications(self):
        """
        Check whether notifications are sent to the correct people whenever a
        translation period is over.
        """
        timestamp = datetime.datetime.now() - datetime.timedelta(hours=1)
        self.release.develfreeze_date = timestamp
        self.release.notifications.before_trans_deadline = True
        self.release.notifications.save()
        self.release.save()

        notify_translation_deadline()

        # Sorted mails list
        mails = key_sort(mail.outbox, 'to')

        self.assertEqual(len(mails), 5)
        self.assertEqual(mails[0].subject, self._gen_assert_msg(
            '[localhost] Release has '
            'hit the translation deadline: Release1'))

        self.assertEqual(mails[0].to, ['maintainer3@localhost'])
        self.assertEqual(mails[1].to, ['maintainer@localhost'])
        self.assertEqual(mails[2].to, ['reviewer@localhost'])
        self.assertEqual(mails[3].to, ['team_coordinator@localhost'])
        self.assertEqual(mails[4].to, ['team_member@localhost'])
Exemple #3
0
    def test_before_trans_deadline_notifications(self):
        """
        Check whether notifications are sent to the correct people whenever a
        the translation deadline approaches.
        """
        timestamp = datetime.datetime.now() + datetime.timedelta(hours=47)
        self.release.develfreeze_date = timestamp
        self.release.save()
    
        notify_translation_deadline()

        # Sorted mails list
        mails = key_sort(mail.outbox, 'to')

        self.assertEqual(len(mails), 2)
        self.assertEqual(mails[0].subject, '[localhost] Release about '
        'to hit the translation deadline: Release1')
        
        self.assertEqual(mails[0].to, ['team_coordinator@localhost'])
        self.assertEqual(mails[1].to, ['team_member@localhost'])
Exemple #4
0
    def test_before_trans_deadline_notifications(self):
        """
        Check whether notifications are sent to the correct people whenever a
        the translation deadline approaches.
        """
        timestamp = datetime.datetime.now() + datetime.timedelta(hours=47)
        self.release.develfreeze_date = timestamp
        self.release.save()

        notify_translation_deadline()

        # Sorted mails list
        mails = key_sort(mail.outbox, 'to')

        self.assertEqual(len(mails), 3)
        self.assertEqual(
            mails[0].subject,
            self._gen_assert_msg('[localhost] Release about '
                                 'to hit the translation deadline: Release1'))

        self.assertEqual(mails[0].to, ['reviewer@localhost'])
        self.assertEqual(mails[1].to, ['team_coordinator@localhost'])
        self.assertEqual(mails[2].to, ['team_member@localhost'])