-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/review #55
Feature/review #55
Conversation
@@ -6,10 +6,16 @@ | |||
|
|||
class ReviewSerializer(serializers.ModelSerializer): | |||
game_request_id = serializers.IntegerField(source="game_request.id", read_only=True) | |||
author_id = serializers.SerializerMethodField() | |||
author_nickname = serializers.CharField(source="game_request.user.nickname", read_only=True) | |||
maet_nickname = serializers.CharField(source="game_request.mate.nickname", read_only=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
변수에 오타가 있네요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 감사합니다!
|
||
class Meta: | ||
model = Review | ||
fields = ["game_request_id", "rating", "content", "created_at"] | ||
fields = ["game_request_id", "author_id", "author_nickname", "maet_nickname", "rating", "content", "created_at"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기도 위에 오타난거 수정하시면 됩니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
네!
src/reviews/tests/test_review.py
Outdated
# 추가된 필드 확인 (author_id, author_nickname, maet_nickname) | ||
self.assertEqual(response.data["results"][0]["author_id"], self.user.id) | ||
self.assertEqual(response.data["results"][0]["author_nickname"], "사용자임") | ||
self.assertEqual(response.data["results"][0]["maet_nickname"], "mate임") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기두 수정하셔야 합니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵
포스트맨 테스트 했습니다!