예제 #1
0
def store_likes(user, likes):
    from django_facebook.api import FacebookAPI

    logger.info("celery is storing %s likes" % len(likes))
    FacebookAPI._store_likes(user, likes)

    return likes
예제 #2
0
def store_friends(user, friends):
    from django_facebook.api import FacebookAPI

    logger.info("celery is storing %s friends" % len(friends))
    FacebookAPI._store_friends(user, friends)

    return friends
예제 #3
0
 def test_no_birthday(self):
     facebook_data = test_users['no_birthday']
     django_user_data = FacebookAPI._convert_facebook_data(facebook_data)
     django_user_data_valid = {
         'website': 'www.pytell.com',
         'username': u'jpytell',
         'first_name': 'Jonathan',
         'last_name': 'Pytell',
         'verified': True,
         'name': 'Jonathan Pytell',
         'image': 'http://graph.facebook.com/me/picture?type=large',
         'facebook_id': '776872663',
         'about_me': None,
         'updated_time': '2010-01-01T18:13:17+0000',
         'date_of_birth': None,
         'facebook_name': 'Jonathan Pytell',
         'link': 'http://www.facebook.com/jpytell',
         'location': {
             'id': None,
             'name': None
         },
         'timezone': -4,
         'image_thumb': 'http://graph.facebook.com/me/picture',
         'facebook_profile_url': 'http://www.facebook.com/jpytell',
         'id': '776872663',
         'website_url': u'http://www.pytell.com/'
     }
     self.assertEqualUserData(django_user_data, django_user_data_valid)
 def test_partial_birthday(self):
     facebook_data = test_users["partial_birthday"]
     django_user_data = FacebookAPI._convert_facebook_data(facebook_data)
     django_user_data_valid = {
         "last_name": "Oleary",
         "image": "http://graph.facebook.com/me/picture?type=large",
         "about_me": None,
         "timezone": -5,
         "id": "1225707780",
         "first_name": "Shane",
         "verified": True,
         "facebook_name": "Shane Oleary",
         "location": {"id": None, "name": None},
         "facebook_id": "1225707780",
         "image_thumb": "http://graph.facebook.com/me/picture",
         "website_url": None,
         "username": u"shane_oleary",
         "date_of_birth": None,
         "birthday": "04/07",
         "link": "http://www.facebook.com/profile.php?id=1225707780",
         "name": "Shane Oleary",
         "gender": "man",
         "updated_time": "2010-04-01T14:26:55+0000",
         "facebook_profile_url": "http://www.facebook.com/profile.php?id=1225707780",
     }
     self.assertEqualUserData(django_user_data, django_user_data_valid)
 def test_no_birthday(self):
     facebook_data = test_users["no_birthday"]
     django_user_data = FacebookAPI._convert_facebook_data(facebook_data)
     django_user_data_valid = {
         "website": "www.pytell.com",
         "username": u"jpytell",
         "first_name": "Jonathan",
         "last_name": "Pytell",
         "verified": True,
         "name": "Jonathan Pytell",
         "image": "http://graph.facebook.com/me/picture?type=large",
         "facebook_id": "776872663",
         "about_me": None,
         "updated_time": "2010-01-01T18:13:17+0000",
         "date_of_birth": None,
         "facebook_name": "Jonathan Pytell",
         "link": "http://www.facebook.com/jpytell",
         "location": {"id": None, "name": None},
         "timezone": -4,
         "image_thumb": "http://graph.facebook.com/me/picture",
         "facebook_profile_url": "http://www.facebook.com/jpytell",
         "id": "776872663",
         "website_url": u"http://www.pytell.com/",
     }
     self.assertEqualUserData(django_user_data, django_user_data_valid)
예제 #6
0
 def test_partial_birthday(self):
     facebook_data = test_users['partial_birthday']
     django_user_data = FacebookAPI._convert_facebook_data(facebook_data)
     django_user_data_valid = {
         'last_name':
         'Oleary',
         'image':
         'http://graph.facebook.com/me/picture?type=large',
         'about_me':
         None,
         'timezone':
         -5,
         'id':
         '1225707780',
         'first_name':
         'Shane',
         'verified':
         True,
         'facebook_name':
         'Shane Oleary',
         'location': {
             'id': None,
             'name': None
         },
         'facebook_id':
         '1225707780',
         'image_thumb':
         'http://graph.facebook.com/me/picture',
         'website_url':
         None,
         'username':
         u'shane_oleary',
         'date_of_birth':
         None,
         'birthday':
         '04/07',
         'link':
         'http://www.facebook.com/profile.php?id=1225707780',
         'name':
         'Shane Oleary',
         'gender':
         'man',
         'updated_time':
         '2010-04-01T14:26:55+0000',
         'facebook_profile_url':
         'http://www.facebook.com/profile.php?id=1225707780'
     }
     self.assertEqualUserData(django_user_data, django_user_data_valid)
예제 #7
0
def store_likes(user, likes):
    from django_facebook.api import FacebookAPI
    logger.info('celery is storing %s likes' % len(likes))
    FacebookAPI._store_likes(user, likes)

    return likes
예제 #8
0
def store_friends(user, friends):
    from django_facebook.api import FacebookAPI
    logger.info('celery is storing %s friends' % len(friends))
    FacebookAPI._store_friends(user, friends)

    return friends