Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding APIs for app test user. #172

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions facebook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,24 @@ def get_app_access_token(self, app_id, app_secret):

return self.request("oauth/access_token", args=args)["access_token"]

def create_test_user(self, app_id, app_access_token, **kwargs):
"""Creates test user for the app."""
args = {'access_token': app_access_token, 'method': 'post'}
args.update(kwargs)
return self.request(app_id + "/accounts/test-users", args=args)

def get_test_users(self, app_id, app_access_token, **kwargs):
"""Get all test users created for the app."""
args = {'access_token': app_access_token}
args.update(kwargs)
return self.request(app_id + "/accounts/test-users", args=args)

def edit_test_user(self, user_id, app_access_token, **kwargs):
"""Changed given test user's name or password."""
args = {'access_token': app_access_token, 'method': 'post'}
args.update(kwargs)
return self.request(user_id, args=args)

def get_access_token_from_code(
self, code, redirect_uri, app_id, app_secret):
"""Get an access token from the "code" returned from an OAuth dialog.
Expand Down