def _test_connect_foursquare(self): print "test_connect_foursquare" from unifide_backend.action.social.foursquare.action import get_access_token_from_fsq, save_fsq_user user_id = "xaa8LzkwtCCgb6BeP" code = "GHBWA21LLHMTGG4NOZEYZ0NHC3BT1CP0MERIJUPF0Y0OYF50" fsq_user_obj = save_fsq_user(user_id, get_access_token_from_fsq(code)) assert fsq_user_obj is not None
def connect_foursquare(): """ (PUT: social_connect/foursquare) """ from unifide_backend.action.social.foursquare.action import get_access_token_from_fsq, save_fsq_user verb = "put" noun = "social_connect/foursquare" #req_vars user_id = request.form.get("user_id") brand_name = request.form.get("brand_name") code = request.form.get("code") #auth check #to-do try: fsq_user_obj = save_fsq_user(user_id, brand_name, get_access_token_from_fsq(code)) except: return jsonify({"status": "error", "error": "Failed to save foursquare user."}) return jsonify({"status": "ok"})