Example #1
0
    def test_notify_parse_error(self):
        notify_parse_error(
            self.subproject,
            self.get_translation(),
            'Failed merge',
            'test/file.po',
        )

        # Check mail (second one is for admin)
        self.assertEqual(len(mail.outbox), 2)
        self.assertEqual(
            mail.outbox[0].subject,
            '[Weblate] Parse error in Test/Test'
        )

        # Add project owner
        self.subproject.project.owners.add(self.second_user())
        notify_parse_error(
            self.subproject,
            self.get_translation(),
            'Error\nstatus',
            'test/file.po',
        )

        # Check mail (second one is for admin)
        self.assertEqual(len(mail.outbox), 5)
Example #2
0
    def test_notify_parse_error(self):
        notify_parse_error(
            self.subproject,
            self.get_translation(),
            'Failed merge',
            'test/file.po',
        )

        # Check mail (second one is for admin)
        self.assertEqual(len(mail.outbox), 2)
        self.assertEqual(
            mail.outbox[0].subject,
            '[Weblate] Parse error in Test/Test'
        )

        # Add project owner
        self.subproject.project.owners.add(self.second_user())
        notify_parse_error(
            self.subproject,
            self.get_translation(),
            'Error\nstatus',
            'test/file.po',
        )

        # Check mail (second one is for admin)
        self.assertEqual(len(mail.outbox), 5)