Skip to content

Commit

Permalink
[ckan#7749] fix hyphen tokens for test_revoke too
Browse files Browse the repository at this point in the history
  • Loading branch information
wardi committed Aug 11, 2023
1 parent 5fbe064 commit 159e81c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ckan/tests/cli/test_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ def test_revoke(self, cli):
call_action(u"api_token_create", user=user[u"id"], name=u"first token")
tid = model.Session.query(model.ApiToken).first().id

# tid must be escaped. When it starts with a hyphen it treated as a
# flag otherwise.
args = f'user token revoke "{tid}"'
# tid must be prefixed by --. When it starts with a hyphen it treated
# as a flag otherwise.
args = f'user token revoke -- "{tid}"'
result = cli.invoke(ckan, args)
assert not result.exit_code, result.output
assert u"API Token has been revoked" in result.output
Expand Down

0 comments on commit 159e81c

Please sign in to comment.