aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/tests/tools.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/tests/tools.py')
-rw-r--r--mediagoblin/tests/tools.py58
1 files changed, 0 insertions, 58 deletions
diff --git a/mediagoblin/tests/tools.py b/mediagoblin/tests/tools.py
index d839373b..57dea7b0 100644
--- a/mediagoblin/tests/tools.py
+++ b/mediagoblin/tests/tools.py
@@ -347,61 +347,3 @@ def fixture_add_comment_report(comment=None, reported_user=None,
return comment_report
-def fixture_add_oauth_client(client_name=None, client_type="native",
- redirect_uri=None, contacts=None):
-
- client_id = random_string(22, OAUTH_ALPHABET)
- client_secret = random_string(43, OAUTH_ALPHABET)
-
- client = Client(
- id=client_id,
- secret=client_secret,
- expirey=None,
- application_type=client_type,
- application_name=client_name,
- contacts=contacts,
- redirect_uri=redirect_uri
- )
- client.save()
-
- return client
-
-def fixture_add_oauth_request_token(user, client=None):
- if client is None:
- client = fixture_add_oauth_client()
-
- rt_token = random_string(22, OAUTH_ALPHABET)
- rt_secret = random_string(43, OAUTH_ALPHABET)
- rt_verifier = random_string(22, OAUTH_ALPHABET)
-
- request_token = RequestToken(
- token=rt_token,
- secret=rt_secret,
- user=user.id,
- used=True,
- authenticated=True,
- verifier=rt_verifier,
- )
- request_token.save()
-
- return request_token
-
-def fixture_add_oauth_access_token(user, client=None, request_token=None):
- if client is None:
- client = fixture_add_oauth_client()
-
- if request_token is None:
- request_token = fixture_add_oauth_request_token(user)
-
- at_token = random_string(22, OAUTH_ALPHABET)
- at_secret = random_string(43, OAUTH_ALPHABET)
-
- access_token = AccessToken(
- token=at_token,
- secret=at_secret,
- user=user.id,
- request_token=request_token.token
- )
- access_token.save()
-
- return access_token