def test_dont_send_untranslated_language_email(self, strings_are_translated): strings_are_translated.return_value = False u = User.objects.get(username='******') send_welcome_email(u.pk, 'de') eq_([], mail.outbox)
def test_default_language_email(self): testuser = self.user_model.objects.get(username="******") send_welcome_email(testuser.pk, settings.WIKI_DEFAULT_LANGUAGE) welcome_email = mail.outbox[0] expected_to = [testuser.email] self.assertEqual(expected_to, welcome_email.to)
def test_default_language_email(self): testuser = self.user_model.objects.get(username='******') send_welcome_email(testuser.pk, settings.WIKI_DEFAULT_LANGUAGE) welcome_email = mail.outbox[0] expected_to = [testuser.email] self.assertEqual(expected_to, welcome_email.to) self.assertTrue(u'utm_campaign=welcome' in welcome_email.body)
def test_default_language_email(self): u = User.objects.get(username='******') send_welcome_email(u.pk, settings.WIKI_DEFAULT_LANGUAGE) welcome_email = mail.outbox[0] expected_to = [u.email] eq_(expected_to, welcome_email.to) ok_(u'utm_campaign=welcome' in welcome_email.body)
def test_dont_send_untranslated_language_email(self, strings_are_translated): strings_are_translated.return_value = False testuser = User.objects.get(username='******') send_welcome_email(testuser.pk, 'tlh') # Qapla' eq_([], mail.outbox) send_welcome_email(testuser.pk, 'de') # Servus eq_(1, len(mail.outbox))
def test_dont_send_untranslated_language_email(self, strings_are_translated): strings_are_translated.return_value = False testuser = self.user_model.objects.get(username='******') send_welcome_email(testuser.pk, 'tlh') # Qapla' eq_([], mail.outbox) send_welcome_email(testuser.pk, 'de') # Servus eq_(1, len(mail.outbox))
def test_dont_send_untranslated_language_email(self, strings_are_translated): strings_are_translated.return_value = False testuser = self.user_model.objects.get(username='******') send_welcome_email(testuser.pk, 'en-NZ') self.assertEqual([], mail.outbox) strings_are_translated.return_value = True send_welcome_email(testuser.pk, 'en-NZ') self.assertEqual(1, len(mail.outbox))
def test_dont_send_untranslated_language_email(self, strings_are_translated): strings_are_translated.return_value = False testuser = self.user_model.objects.get(username='******') send_welcome_email(testuser.pk, 'tlh') # mev! eq_([], mail.outbox) strings_are_translated.return_value = True send_welcome_email(testuser.pk, 'tlh') # Qapla'! eq_(1, len(mail.outbox))