Commit ef6e9a99 authored by Michal Čihař's avatar Michal Čihař

Add test for parse error notification

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 980d93de
......@@ -30,6 +30,7 @@ from django.core import mail
from weblate.accounts.models import (
Profile,
notify_merge_failure,
notify_parse_error,
notify_new_string,
notify_new_suggestion,
notify_new_comment,
......@@ -97,6 +98,31 @@ class NotificationTest(ViewTestCase):
# Check mail (second one is for admin)
self.assertEqual(len(mail.outbox), 5)
def test_notify_parse_error(self):
notify_parse_error(
self.subproject,
self.get_translation(),
'Failed merge',
)
# 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'
)
# Check mail (second one is for admin)
self.assertEqual(len(mail.outbox), 5)
def test_notify_new_string(self):
notify_new_string(self.get_translation())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment