예제 #1
0
    def test_in_string_freeze_notifications(self):
        """
        Check whether notifications are sent to the correct people whenever
        the string freeze period starts.
        """
        timestamp = datetime.datetime.now() - datetime.timedelta(hours=1)
        self.release.stringfreeze_date = timestamp
        self.release.notifications.before_stringfreeze = True
        self.release.notifications.save()
        self.release.save()

        notify_string_freeze()

        # 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 is in string '
                                 'freeze period: 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'])
예제 #2
0
    def test_in_string_freeze_notifications(self):
        """
        Check whether notifications are sent to the correct people whenever
        the string freeze period starts.
        """
        timestamp = datetime.datetime.now() - datetime.timedelta(hours=1)
        self.release.stringfreeze_date = timestamp
        self.release.notifications.before_stringfreeze = True
        self.release.notifications.save()
        self.release.save()

        notify_string_freeze()

        # 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 is in string '
            'freeze period: 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'])
예제 #3
0
    def test_before_string_freeze_notifications(self):
        """
        Check whether notifications are sent to the correct people whenever 
        the string freeze period approaches.
        """
        timestamp = datetime.datetime.now() + datetime.timedelta(hours=47)
        self.release.stringfreeze_date = timestamp
        self.release.save()
    
        notify_string_freeze()

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

        self.assertEqual(len(mails), 2)
        self.assertEqual(mails[0].subject, '[localhost] Release about to '
            'enter the string freeze period: Release1')

        self.assertEqual(mails[0].to, ['maintainer3@localhost'])
        self.assertEqual(mails[1].to, ['maintainer@localhost'])
예제 #4
0
    def test_before_string_freeze_notifications(self):
        """
        Check whether notifications are sent to the correct people whenever
        the string freeze period approaches.
        """
        timestamp = datetime.datetime.now() + datetime.timedelta(hours=47)
        self.release.stringfreeze_date = timestamp
        self.release.save()

        notify_string_freeze()

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

        self.assertEqual(len(mails), 2)
        self.assertEqual(
            mails[0].subject,
            self._gen_assert_msg('[localhost] Release about to '
                                 'enter the string freeze period: Release1'))

        self.assertEqual(mails[0].to, ['maintainer3@localhost'])
        self.assertEqual(mails[1].to, ['maintainer@localhost'])