コード例 #1
0
    def test_notify_repository(self):
        change = Change.objects.create(component=self.component,
                                       action=Change.ACTION_MERGE)

        # Check mail
        self.assertEqual(len(mail.outbox), 1)

        # Add project owner
        self.component.project.add_user(self.anotheruser, "@Administration")
        notify_change(change.pk)

        # Check mail
        self.validate_notifications(
            2, "[Weblate] Repository operation in Test/Test")
コード例 #2
0
    def test_notify_parse_error(self):
        change = Change.objects.create(
            translation=self.get_translation(),
            details={"error_message": "Failed merge", "filename": "test/file.po"},
            action=Change.ACTION_PARSE_ERROR,
        )

        # Check mail
        self.assertEqual(len(mail.outbox), 1)

        # Add project owner
        self.component.project.add_user(self.anotheruser, "@Administration")
        notify_change(change.pk)

        # Check mail
        self.validate_notifications(3, "[Weblate] Parse error in Test/Test")
コード例 #3
0
    def test_notify_parse_error(self):
        change = Change.objects.create(
            translation=self.get_translation(),
            details={'error_message': 'Failed merge', 'filename': 'test/file.po'},
            action=Change.ACTION_PARSE_ERROR,
        )

        # Check mail
        self.assertEqual(len(mail.outbox), 1)

        # Add project owner
        self.component.project.add_user(self.second_user(), '@Administration')
        notify_change(change.pk)

        # Check mail
        self.validate_notifications(3, '[Weblate] Parse error in Test/Test')
コード例 #4
0
    def test_notify_merge_failure(self):
        change = Change.objects.create(
            component=self.component,
            details={"error": "Failed merge", "status": "Error\nstatus"},
            action=Change.ACTION_FAILED_MERGE,
        )

        # Check mail
        self.assertEqual(len(mail.outbox), 1)

        # Add project owner
        self.component.project.add_user(self.anotheruser, "@Administration")
        notify_change(change.pk)

        # Check mail
        self.validate_notifications(2, "[Weblate] Repository failure in Test/Test")
コード例 #5
0
    def test_notify_merge_failure(self):
        change = Change.objects.create(
            component=self.component,
            details={'error': 'Failed merge', 'status': 'Error\nstatus'},
            action=Change.ACTION_FAILED_MERGE,
        )

        # Check mail
        self.assertEqual(len(mail.outbox), 1)

        # Add project owner
        self.component.project.add_user(self.second_user(), '@Administration')
        notify_change(change.pk)

        # Check mail
        self.validate_notifications(2, '[Weblate] Repository failure in Test/Test')
コード例 #6
0
    def test_notify_new_language(self):
        anotheruser = self.anotheruser
        change = Change.objects.create(
            user=anotheruser,
            component=self.component,
            details={"language": "de"},
            action=Change.ACTION_REQUESTED_LANGUAGE,
        )

        # Check mail
        self.assertEqual(len(mail.outbox), 1)

        # Add project owner
        self.component.project.add_user(anotheruser, "@Administration")
        notify_change(change.pk)

        # Check mail
        self.validate_notifications(2, "[Weblate] New language request in Test/Test")
コード例 #7
0
    def test_notify_new_language(self):
        second_user = self.second_user()
        change = Change.objects.create(
            user=second_user,
            component=self.component,
            details={'language': 'de'},
            action=Change.ACTION_REQUESTED_LANGUAGE,
        )

        # Check mail
        self.assertEqual(len(mail.outbox), 1)

        # Add project owner
        self.component.project.add_user(second_user, '@Administration')
        notify_change(change.pk)

        # Check mail
        self.validate_notifications(2, '[Weblate] New language request in Test/Test')
コード例 #8
0
ファイル: test_notifications.py プロジェクト: nijel/weblate
    def test_notify_parse_error(self):
        change = Change.objects.create(
            translation=self.get_translation(),
            details={
                'error': 'Failed merge',
                'filename': 'test/file.po',
            },
            action=Change.ACTION_PARSE_ERROR,
        )

        # Check mail
        self.assertEqual(len(mail.outbox), 1)

        # Add project owner
        self.component.project.add_user(self.second_user(), '@Administration')
        notify_change(change.pk)

        # Check mail
        self.validate_notifications(3, '[Weblate] Parse error in Test/Test')
コード例 #9
0
ファイル: test_notifications.py プロジェクト: nijel/weblate
    def test_notify_merge_failure(self):
        change = Change.objects.create(
            component=self.component,
            details={
                'error': 'Failed merge',
                'status': 'Error\nstatus',
            },
            action=Change.ACTION_FAILED_MERGE,
        )

        # Check mail
        self.assertEqual(len(mail.outbox), 1)

        # Add project owner
        self.component.project.add_user(self.second_user(), '@Administration')
        notify_change(change.pk)

        # Check mail
        self.validate_notifications(3, '[Weblate] Merge failure in Test/Test')
コード例 #10
0
ファイル: test_notifications.py プロジェクト: nijel/weblate
    def test_notify_new_language(self):
        second_user = self.second_user()
        change = Change.objects.create(
            user=second_user,
            component=self.component,
            details={'language': 'de'},
            action=Change.ACTION_REQUESTED_LANGUAGE,
        )

        # Check mail
        self.assertEqual(len(mail.outbox), 1)

        # Add project owner
        self.component.project.add_user(second_user, '@Administration')
        notify_change(change.pk)

        # Check mail
        self.validate_notifications(
            2,
            '[Weblate] New language request in Test/Test'
        )