예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
파일: test_tasks.py 프로젝트: ekmixon/kuma
    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)
예제 #4
0
파일: test_tasks.py 프로젝트: qaziqwa/kuma
    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)
예제 #5
0
    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)
예제 #6
0
파일: test_tasks.py 프로젝트: samucc/kuma
    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)
예제 #7
0
파일: test_tasks.py 프로젝트: Faldrian/kuma
    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)
예제 #8
0
    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))
예제 #9
0
    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))
예제 #10
0
파일: test_tasks.py 프로젝트: qaziqwa/kuma
    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))
예제 #11
0
    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))
예제 #12
0
파일: test_tasks.py 프로젝트: bluemini/kuma
    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))