Open werberger opened 1 year ago
Patch coverage: 81.25
% and project coverage change: -0.04
:warning:
Comparison is base (
9343835
) 82.48% compared to head (76ef839
) 82.44%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
This looks good so far, in that it creates a view that lists all circles.
The next step would be to return only the circles that the requesting user has the right to view. Check the code for the existing "circles" view to get an idea of how to narrow down the queryset.
I have got this working. At least it works in Postman. However attempting a GET request in the browser returns:
"detail": "Authentication credentials were not provided."
I have attempted including the token as part of the url, i.e.
http://127.0.0.1:8000/api/v1/circles/?format=api&Authorization=Token
as well as passing it as a query parameter, i.e. in the browser console, using
document.cookie = 'Authorization=Token
;'
but neither of these solutions work
Assuming this doesn't matter I'll update the PR. But if it does matter, would appreciate some suggestions.
Typically, authorization tokens are passed in via a request header. See the following document for more details about authorizing requests with Postman: https://learning.postman.com/docs/sending-requests/authorization/
Typically, authorization tokens are passed in via a request header. See the following document for more details about authorizing requests with Postman: https://learning.postman.com/docs/sending-requests/authorization/
Is this article not talking about passing them in Postman? I have it working in Postman. It is in the browsable API that I can't get it working.
@brylie I managed to get it working - I needed to use a browser extension to edit the header.
Ah, I understand. FWIW, we don't need to test these API endpoints in a browser since they will be used in a mobile client. Only Postman should be necessary, along with automated tests from Python.
To explain the rogue activity on this PR, I pushed my work on #197 which automatically added it to this PR. I subsequently reverted the commits.
I hope I haven't caused any issues @brylie. Please let me know if there was a better way to have dealt with this.
This resolves issue #195.
@brylie please review and give me any feedback. I have tested using the Browsable API and Postman.
Test coverage was 83% isort and black both run.