Conversation
Comment on lines
99
to
100
Contributor
There was a problem hiding this comment.
이때는 인증이 아니라 권한과 관련된 부분이라 401 보다는 403이 맞을 것 같애 403 FORBIDDEN
Comment on lines
103
to
110
Contributor
There was a problem hiding this comment.
200으로 줘도 무방하지만, 대개는 204 NO_CONTENT로 주고, data는 따로 보내지 않음
Suggested change
| return JsonResponse( | |
| { | |
| "post": | |
| { | |
| "title": to_delete_post.title, | |
| "text": to_delete_post.text, | |
| } | |
| }, status=OK) | |
| return JsonResponse(status=204) |
Comment on lines
195
to
198
Contributor
There was a problem hiding this comment.
이 부분은 요구사항이 title, text를 리턴해달라고 했다면, 추가되는게 맞지만 대개의 경우에는 204에 data는 따로 응답으로 보내진 않음 - 참고만
Contributor
There was a problem hiding this comment.
위에 적은 것 처럼, 테스트 코드에서 given 설정해줄 때, author id도 invalid 하다는 것을 확실히 명시해주면 좋을 것 같애
invalid_author_id = 12314
Comment on lines
226
to
229
…IT/CtrlF_Backend into jinho-step2-remove-post
9a69ce2 to
043b6d0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
테스트 생성
post_id값과 post의author와 request_body의author이 같을 때* 삭제 하고, 응답으로 삭제한 post의 제목과 내용을 리턴한다.
post_id가 유효하지 않을 때* 삭제를 하지 않고,
post를 찾을 수 없습니다.라는 메세지를 리턴한다.post_id는 유효하지만, post의author와 request_body의author이 다를 때* 삭제를 하지 않고,
권한이 없습니다.라는 메세지를 리턴한다.구현 코드 작성
테스트
통과