-
-
-
reviewboard/webapi/resources/oauth2_token.py (Diff revision 1) 'ValidationError' imported but unused
-
reviewboard/webapi/resources/oauth2_token.py (Diff revision 1) 'ObjectDoesNotExist' imported but unused
-
-
reviewboard/webapi/resources/oauth2_token.py (Diff revision 1) 'webapi_response_errors' imported but unused
-
reviewboard/webapi/resources/oauth2_token.py (Diff revision 1) 'webapi_request_fields' imported but unused
-
reviewboard/webapi/resources/oauth2_token.py (Diff revision 1) 'webapi_login_required' imported but unused
-
-
-
reviewboard/webapi/resources/oauth2_token.py (Diff revision 1) 'PERMISSION_DENIED' imported but unused
-
reviewboard/webapi/resources/oauth2_token.py (Diff revision 1) 'INVALID_FORM_DATA' imported but unused
-
[OAuth2Provider] Add webAPI end point for user to remove OAuth2 token from My Account page
Review Request #7964 — Created Feb. 15, 2016 and discarded
A new webAPI end point is added for user to GET and DELETE a OAuth2 token given OAuth2 token ID. The webAPI is meant to be called from My Account for user to remove a OAuth2 token.
Command run: python ./tests/runtests.py reviewboard.webapi.tests.test_oauth2_token
Test GET for list of OAuth2 token
Test GET and DELETE for OAuth2 tokenThis a copy from test_api_token
Description | From | Last Updated |
---|---|---|
'json' imported but unused |
![]() |
|
'ValidationError' imported but unused |
![]() |
|
'ObjectDoesNotExist' imported but unused |
![]() |
|
'_' imported but unused |
![]() |
|
'webapi_response_errors' imported but unused |
![]() |
|
'webapi_request_fields' imported but unused |
![]() |
|
'webapi_login_required' imported but unused |
![]() |
|
'NOT_LOGGED_IN' imported but unused |
![]() |
|
'DOES_NOT_EXIST' imported but unused |
![]() |
|
'PERMISSION_DENIED' imported but unused |
![]() |
|
'INVALID_FORM_DATA' imported but unused |
![]() |
|
'resources' imported but unused |
![]() |
|
'Application' imported but unused |
![]() |
|
'oauth2_token_item_mimetype' imported but unused |
![]() |
|
Col: 1 E302 expected 2 blank lines, found 1 |
![]() |
|
oauth2_provider is an outside module, so should belong in the same import group, in alphabetical order. |
|
|
Same import group. |
|
|
This seems to be missing a _get_queryset. It'd need one in order to limit results to the user, and to … |
|
|
Blank line between these. |
|
|
This is an outside module, so it should be part of the next import group. |
|
|
Make sure things are in alphabetical order. |
|
|
No need for parens. |
|
|
Indented too far. |
|
|
We don't put one argument per line. Ends up being pretty long this way. Same below. |
|
|
Same line, no trailing comma, since this is a function call. |
|
|
Blank line between these. |
|
|
Same line, no comma. |
|
|
Blank line between these. Same below. |
|
|
Col: 18 E711 comparison to None should be 'if cond is None:' |
![]() |
|
Col: 20 E711 comparison to None should be 'if cond is None:' |
![]() |
|
Col: 24 E711 comparison to None should be 'if cond is None:' |
![]() |
|
Col: 49 E128 continuation line under-indented for visual indent |
![]() |
|
Col: 18 E711 comparison to None should be 'if cond is None:' |
![]() |
|
Col: 20 E711 comparison to None should be 'if cond is None:' |
![]() |
|
Col: 24 E711 comparison to None should be 'if cond is None:' |
![]() |
|
Col: 49 E128 continuation line under-indented for visual indent |
![]() |

Change Summary:
Add UnitTest
Testing Done: |
|
|||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+229 -23) |

-
Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/accountPrefsPage/views/oauth2TokensView.js reviewboard/static/rb/js/resources/models/oauth2TokenModel.js Tool: Pyflakes Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/accountPrefsPage/views/oauth2TokensView.js reviewboard/static/rb/js/resources/models/oauth2TokenModel.js
-
-
reviewboard/webapi/tests/test_oauth2_token.py (Diff revision 2) 'oauth2_token_item_mimetype' imported but unused
-
Change Summary:
Update reviewbot

-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/accountPrefsPage/views/oauth2TokensView.js reviewboard/static/rb/js/resources/models/oauth2TokenModel.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/accountPrefsPage/views/oauth2TokensView.js reviewboard/static/rb/js/resources/models/oauth2TokenModel.js
-
The first couple of files just remove stuff from prior changes. Instead, you should update the prior changes to remove the code there, so that each change is a cohesive unit.
-
reviewboard/webapi/resources/__init__.py (Diff revision 3) oauth2_provider
is an outside module, so should belong in the same import group, in alphabetical order. -
-
reviewboard/webapi/resources/oauth2_token.py (Diff revision 3) This seems to be missing a
_get_queryset
. It'd need one in order to limit results to the user, and to do permission checking, like other resources that are children of the user resource. -
-
reviewboard/webapi/tests/test_oauth2_token.py (Diff revision 3) This is an outside module, so it should be part of the next import group.
-
reviewboard/webapi/tests/test_oauth2_token.py (Diff revision 3) Make sure things are in alphabetical order.
-
-
-
reviewboard/webapi/tests/test_oauth2_token.py (Diff revision 3) We don't put one argument per line. Ends up being pretty long this way.
Same below.
-
reviewboard/webapi/tests/test_oauth2_token.py (Diff revision 3) Same line, no trailing comma, since this is a function call.
-
-
-
reviewboard/webapi/tests/test_oauth2_token.py (Diff revision 3) Blank line between these.
Same below.
Change Summary:
Update CR
Diff: |
Revision 4 (+284)
|
---|

-
Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/resources/models/oauth2TokenModel.js Tool: Pyflakes Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/resources/models/oauth2TokenModel.js
-
reviewboard/webapi/tests/test_oauth2_token.py (Diff revision 4) Col: 18 E711 comparison to None should be 'if cond is None:'
-
reviewboard/webapi/tests/test_oauth2_token.py (Diff revision 4) Col: 20 E711 comparison to None should be 'if cond is None:'
-
reviewboard/webapi/tests/test_oauth2_token.py (Diff revision 4) Col: 24 E711 comparison to None should be 'if cond is None:'
-
reviewboard/webapi/tests/test_oauth2_token.py (Diff revision 4) Col: 49 E128 continuation line under-indented for visual indent
Change Summary:
Update pep8; Remove wip status
Summary: |
|
||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Diff: |
Revision 5 (+284)
|

-
Tool: Pyflakes Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/resources/models/oauth2TokenModel.js Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/resources/models/oauth2TokenModel.js
-
reviewboard/webapi/tests/test_oauth2_token.py (Diff revision 5) Col: 18 E711 comparison to None should be 'if cond is None:'
-
reviewboard/webapi/tests/test_oauth2_token.py (Diff revision 5) Col: 20 E711 comparison to None should be 'if cond is None:'
-
reviewboard/webapi/tests/test_oauth2_token.py (Diff revision 5) Col: 24 E711 comparison to None should be 'if cond is None:'
-
reviewboard/webapi/tests/test_oauth2_token.py (Diff revision 5) Col: 49 E128 continuation line under-indented for visual indent
Change Summary:
Update pep8; Not sure why the previous never commited
Diff: |
Revision 6 (+284)
|
---|

-
Tool: PEP8 Style Checker Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/resources/models/oauth2TokenModel.js Tool: Pyflakes Processed Files: reviewboard/webapi/resources/__init__.py reviewboard/webapi/tests/test_oauth2_token.py reviewboard/webapi/resources/oauth2_token.py reviewboard/webapi/tests/urls.py reviewboard/webapi/tests/mimetypes.py reviewboard/webapi/resources/user.py Ignored Files: reviewboard/static/rb/js/resources/models/oauth2TokenModel.js