コード例 #1
0
ファイル: test_views.py プロジェクト: josephbosire/remo
    def test_mozillian_username_exists(self, mocked_is_vouched):
        """Test that if an Anonymous Mozillians changes his

        settings in the mozillians.org, we update his username
        on our portal.
        """
        mozillian = UserFactory.create(groups=['Mozillians'])
        mocked_is_vouched.return_value = {'is_vouched': True,
                                          'email': mozillian.email,
                                          'username': '******',
                                          'full_name': 'Awesome Mozillian'}
        check_mozillian_username.apply()
        user = User.objects.get(email=mozillian.email)
        eq_(user.userprofile.mozillian_username, u'Mozillian')
        eq_(user.get_full_name(), u'Awesome Mozillian')
コード例 #2
0
ファイル: test_views.py プロジェクト: pemmasanikrishna/remo
    def test_mozillian_username_exists(self, mocked_is_vouched):
        """Test that if an Anonymous Mozillians changes his

        settings in the mozillians.org, we update his username
        on our portal.
        """
        mozillian = UserFactory.create(groups=['Mozillians'])
        mocked_is_vouched.return_value = {'is_vouched': True,
                                          'email': mozillian.email,
                                          'username': '******',
                                          'full_name': 'Awesome Mozillian'}
        check_mozillian_username.apply()
        user = User.objects.get(email=mozillian.email)
        eq_(user.userprofile.mozillian_username, u'Mozillian')
        eq_(user.get_full_name(), u'Awesome Mozillian')
コード例 #3
0
ファイル: test_views.py プロジェクト: MichaelKohler/remo
    def test_mozillian_username_missing(self, mocked_lookup):
        """Test that if a Mozillian changes his

        settings in the mozillians.org, we update his username
        on our portal.
        """
        mozillian = UserFactory.create(
            groups=['Mozillians'], first_name='Awesome',
            last_name='Mozillian',
            userprofile__mozillian_username='******')
        mocked_lookup.return_value = {
            'is_vouched': True,
            'email': mozillian.email,
            'username': '******',
            'full_name': {
                'privacy': 'Mozillians',
                'value': 'Awesome Mozillian'
            }
        }
        check_mozillian_username.apply()
        user = User.objects.get(email=mozillian.email)
        eq_(user.userprofile.mozillian_username, '')
        eq_(user.get_full_name(), u'Anonymous Mozillian')
コード例 #4
0
ファイル: test_views.py プロジェクト: sourabhsmf/remo
    def test_mozillian_username_missing(self, mocked_lookup):
        """Test that if a Mozillian changes his

        settings in the mozillians.org, we update his username
        on our portal.
        """
        mozillian = UserFactory.create(
            groups=['Mozillians'],
            first_name='Awesome',
            last_name='Mozillian',
            userprofile__mozillian_username='******')
        mocked_lookup.return_value = {
            'is_vouched': True,
            'email': mozillian.email,
            'username': '******',
            'full_name': {
                'privacy': 'Mozillians',
                'value': 'Awesome Mozillian'
            }
        }
        check_mozillian_username.apply()
        user = User.objects.get(email=mozillian.email)
        eq_(user.userprofile.mozillian_username, '')
        eq_(user.get_full_name(), u'Anonymous Mozillian')