Example #1
0
 def create_user_association(self, user, token, expires, user_data):
     """ Create UserAssociation """
     assoc = UserAssociation(user=user,
                             token=str(token),
                             expires=expires,
                             identifier=user_data['id'])
     assoc.save()
     return assoc
Example #2
0
 def create_user_association(self, user, token, expires, user_data):
     """ Create UserAssociation """
     assoc = UserAssociation (
             user=user,
             token=str(token),
             expires=expires,
             identifier=user_data['id']
     )
     assoc.save()
     return assoc
 def setUp(self):
     # logger.debug("callback test case setup")
     self.request = factory.get('/callback',data={'next':'dummy'})
     test_user = User()
     test_user.username = '******'
     test_user.save()
     self.request.user = test_user
     assoc = UserAssociation()
     assoc.user = test_user
     assoc.token = 'facebooktokenstring'
     assoc.expires = datetime.datetime.now() + datetime.timedelta(1)
     assoc.save()
     self.token = OAuth20Token(assoc.token, 5555)
     self.access = OAuthAccess()
Example #4
0
    def create_user_with_fb_profile(self):
        user = User()
        user.username = '******'
        user.email = '*****@*****.**'
        user.first_name = 'With'
        user.last_name = 'FBProfile'
        user.password = '******'
        user.save()
        #create facebook profile
        assoc = UserAssociation(user=user,
                                token='preauthdtoken',
                                expires=datetime.now() + timedelta(1),
                                identifier='8675309')
        assoc.save()

        self.user_with_profile = user
 def setUp(self):
     self.request = factory.get('/callback',data={'next':'dummy'})
     test_user = User()
     test_user.username = '******'
     test_user.email = '*****@*****.**'
     test_user.save()
     self.test_user = test_user
     self.anon_user = AnonymousUser()
     self.request.user = test_user
     assoc = UserAssociation()
     assoc.user = test_user
     assoc.token = 'facebooktokenstring'
     assoc.identifier = 'facebookid'
     assoc.expires = datetime.datetime.now() + datetime.timedelta(1)
     assoc.save()
     self.token = OAuth20Token(str(assoc.token), 5555)
     self.access = OAuthAccess()
Example #6
0
 def create_user_with_fb_profile(self):
     user = User()
     user.username = '******'
     user.email = '*****@*****.**'
     user.first_name = 'With'
     user.last_name = 'FBProfile'
     user.password = '******'
     user.save()
     #create facebook profile
     assoc = UserAssociation(
         user=user,
         token='preauthdtoken',
         expires = datetime.now() + timedelta(1),
         identifier='8675309'
     )
     assoc.save()
     
     self.user_with_profile = user