Skip to content

Instantly share code, notes, and snippets.

@sunglassatnight
Created December 2, 2013 15:57
Show Gist options
  • Save sunglassatnight/7751680 to your computer and use it in GitHub Desktop.
Save sunglassatnight/7751680 to your computer and use it in GitHub Desktop.
foursquare auth
from pingspot.dal.users import UserService
from sys import uuid
def test_foursquare_auth_token(dal, uniqueuser):
user = uniqueuser()
auth_token = str(uuid.uuid4())
user.foursquare_auth_token = auth_token
saved_user = UserService.users.get_or_create_by_social_identifier(user)
assert user.foursquare_auth_token == auth_token
assert user.foursquare_auth_token == saved_user.foursquare_auth_token
@six8
Copy link

six8 commented Dec 2, 2013

UserService.users.get_or_create_by_social_identifier(user) should actually be dal.users.get_or_create_by_social_identifier(user). However, as we discussed in chat, what we need here is dal.users.set_foursquare_auth_token(user, token)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment