コード例 #1
0
ファイル: tests.py プロジェクト: BenoitNorrin/Django-facebook
    def test_persistent_graph(self):
        request = RequestMock().get('/')
        request.session = {}
        request.user = AnonymousUser()

        graph = get_facebook_graph(access_token='short_username')
        FacebookUserConverter(graph)
        action, user = connect_user(self.request, facebook_graph=graph)
        self.assertEqual(action, CONNECT_ACTIONS.REGISTER)
コード例 #2
0
    def test_persistent_graph(self):
        request = RequestMock().get('/')
        request.session = {}
        request.user = AnonymousUser()

        graph = get_facebook_graph(access_token='short_username')
        FacebookUserConverter(graph)
        action, user = connect_user(self.request, facebook_graph=graph)
        self.assertEqual(action, CONNECT_ACTIONS.REGISTER)
コード例 #3
0
ファイル: tests.py プロジェクト: BenoitNorrin/Django-facebook
 def test_gender_matching(self):
     request = RequestMock().get('/')
     request.session = {}
     request.user = AnonymousUser()
     graph = get_persistent_graph(request, access_token='paul')
     converter = FacebookUserConverter(graph)
     base_data = converter.facebook_profile_data()
     self.assertEqual(base_data['gender'], 'male')
     data = converter.facebook_registration_data()
     self.assertEqual(data['gender'], 'm')
     action, user = connect_user(self.request, facebook_graph=graph)
     self.assertEqual(user.get_profile().gender, 'm')
コード例 #4
0
 def test_gender_matching(self):
     request = RequestMock().get('/')
     request.session = {}
     request.user = AnonymousUser()
     graph = get_persistent_graph(request, access_token='paul')
     converter = FacebookUserConverter(graph)
     base_data = converter.facebook_profile_data()
     self.assertEqual(base_data['gender'], 'male')
     data = converter.facebook_registration_data()
     self.assertEqual(data['gender'], 'm')
     action, user = connect_user(self.request, facebook_graph=graph)
     self.assertEqual(user.get_profile().gender, 'm')
コード例 #5
0
ファイル: tests.py プロジェクト: ESBerkeley/CalClassified
 def test_long_username(self):
     request = RequestMock().get('/')
     request.session = {}
     request.user = AnonymousUser()
     graph = get_persistent_graph(request, access_token='long_username')
     converter = FacebookUserConverter(graph)
     base_data = converter.facebook_registration_data()
     action, user = connect_user(self.request, facebook_graph=graph)
     self.assertEqual(len(base_data['username']), 30)
     self.assertEqual(len(user.username), 30)
     self.assertEqual(len(user.first_name), 30)
     self.assertEqual(len(user.last_name), 30)
コード例 #6
0
 def test_persistent_graph(self):
     request = RequestMock().get('/')
     request.session = {}
     request.user = AnonymousUser()
     get_persistent_graph(request, access_token='short_username')
コード例 #7
0
 def test_persistent_graph(self):
     request = RequestMock().get('/')
     request.session = {}
     request.user = AnonymousUser()
     get_persistent_graph(request, access_token='short_username')