Skip to content

Commit f13ab3a

Browse files
committed
add AccountDescribeTestCase
Fix #168 Changes to be committed: modified: api/views.py modified: tests/test_views/test_api_accounts_describe.py
1 parent 23fb085 commit f13ab3a

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

api/views.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,10 @@ def get(self, request, username: str, temp_identifier: str):
197197
{"activation_success": False, "status": status.HTTP_400_BAD_REQUEST}
198198
)
199199

200-
201-
# Source: https://www.django-rest-framework.org/api-guide/authentication/#by-exposing-an-api-endpoint
202200
class ApiAccountsDescribe(APIView):
203-
"""
204-
Account details
201+
"""Account details
205202
206203
--------------------
207-
No schema for this request since only the Authorization header is required.
208204
The word 'Token' must be included in the header.
209205
For example: 'Token 627626823549f787c3ec763ff687169206626149'
210206
"""
@@ -222,16 +218,12 @@ class ApiAccountsDescribe(APIView):
222218
manual_parameters=auth,
223219
responses={
224220
200: "Authorization is successful.",
225-
403: "Forbidden. Authentication credentials were not provided.",
226-
403: "Invalid token"
221+
403: "Forbidden. Authentication credentials were not provided, or the token is invalid.",
227222
},
228223
tags=["Account Management"],
229224
)
230225
def post(self, request):
231-
"""
232-
Pass the request to the handling function
233-
Source: https://stackoverflow.com/a/31813810
234-
"""
226+
""""""
235227

236228
if request.headers["Authorization"].split(" ")[0] == "Token" or request.headers["Authorization"].split(" ")[0] == "TOKEN":
237229
return POST_api_accounts_describe(

tests/test_views/test_api_accounts_describe.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@
1414

1515
class AccountDescribeTestCase(TestCase):
1616
fixtures = ['tests/fixtures/test_data']
17-
# def setUp(self):
18-
# self.client = APIClient()
1917

20-
2118
def test_success_response(self):
2219
"""200: Authorization is successful.
2320
"""

0 commit comments

Comments
 (0)