added a username parameter to the token generation so that more than one account can be used in testing
parent
24dbd72f4d
commit
b0f7f8cbf7
|
@ -10,13 +10,17 @@ TWO_MINUTES = 120
|
||||||
REFRESH_TOKEN_COOKIE_KEY = 'seleneRefresh'
|
REFRESH_TOKEN_COOKIE_KEY = 'seleneRefresh'
|
||||||
|
|
||||||
|
|
||||||
def generate_access_token(context, expire=False):
|
def generate_access_token(context, username='foo', expire=False):
|
||||||
access_token = AuthenticationToken(
|
access_token = AuthenticationToken(
|
||||||
context.client_config['ACCESS_SECRET'],
|
context.client_config['ACCESS_SECRET'],
|
||||||
ONE_MINUTE
|
ONE_MINUTE
|
||||||
)
|
)
|
||||||
if not expire:
|
if not expire:
|
||||||
access_token.generate(context.account.id)
|
if username == 'bar':
|
||||||
|
account_id = context.bar_account.id
|
||||||
|
else:
|
||||||
|
account_id = context.foo_account.id
|
||||||
|
access_token.generate(account_id)
|
||||||
context.access_token = access_token
|
context.access_token = access_token
|
||||||
|
|
||||||
context.client.set_cookie(
|
context.client.set_cookie(
|
||||||
|
|
Loading…
Reference in New Issue