Commit 9f3f5fb3 authored by Michal Čihař's avatar Michal Čihař

Verify mail sending for new language subscription

parent 9425b577
......@@ -26,6 +26,8 @@ from django.test.client import RequestFactory
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.contrib.messages.storage.fallback import FallbackStorage
from django.core import mail
from django.conf import settings
from trans.models.changes import Change
from trans.models.unitdata import Suggestion
from trans.tests.test_models import RepoTestCase
......@@ -200,6 +202,9 @@ class NewLangTest(ViewTestCase):
self.assertContains(response, 'http://example.com/instructions')
def test_contact(self):
# Hack to allow sending of mails
settings.ADMINS = (('Weblate test', 'noreply@weblate.org'), )
self.project.new_lang = 'contact'
self.project.save()
......@@ -218,6 +223,13 @@ class NewLangTest(ViewTestCase):
self.subproject.get_absolute_url()
)
# Verify mail
self.assertEqual(len(mail.outbox), 1)
self.assertEqual(
mail.outbox[0].subject,
'[Weblate] New language request in Test/Test',
)
def test_add(self):
self.project.new_lang = 'add'
self.project.save()
......
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