Example #1
0
    def test_signal_sets_language_if_none(self):
        """
        Activate 'de' as language and check that user gets this as initial language as he has None.
        """
        translation.activate('de')

        user = mommy.make(UserProfile, language=None, email="*****@*****.**")
        user.ensure_valid_login_key()

        set_or_get_language(user=user, request=None)

        user.refresh_from_db()
        self.assertEqual(user.language, 'de')
Example #2
0
    def test_signal_sets_language_if_none(self):
        """
        Activate 'de' as language and check that user gets this as initial language as he has None.
        """
        translation.activate('de')

        user = mommy.make(UserProfile, language=None)
        user.generate_login_key()

        set_or_get_language(None, user, None)

        user.refresh_from_db()
        self.assertEqual(user.language, 'de')
Example #3
0
    def test_signal_sets_language_if_none(self):
        """
        Activate 'de' as language and check that user gets this as initial language as he has None.
        """
        translation.activate('de')

        user = mommy.make(UserProfile, language=None, email="*****@*****.**")
        user.ensure_valid_login_key()

        set_or_get_language(None, user, None)

        user.refresh_from_db()
        self.assertEqual(user.language, 'de')