-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/58 exam deployment service #77
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
base: develop
Are you sure you want to change the base?
Conversation
98ff653 to
2e7a894
Compare
2e7a894 to
2f59487
Compare
2f59487 to
308b5cd
Compare
Meoyoug
left a comment
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.
코멘트 사항 수정하고 푸시 부탁드립니다.
14ba3b8 to
d2586dc
Compare
- ValidationError를 string에서 dict로 변경 - 검증 함수로 묶어서 함수호출로 변경
- try-except로 non_field_error로 묶지않고 DeploymentValidator에서 발생시킨 예외 그대로 raise되도록 변경
- try-except로 non_field_error로 묶지않고 DeploymentValidator에서 발생시킨 예외 그대로 raise되도록 변경
- validate_not_closed 함수 제거
- exam - cohort 관계 검증 코드 서비스에서 시리얼라이저로 이동
- access_code는 read_only
- view에서 검증하도록 할 예정
d2586dc to
322c6a8
Compare
| for field, value in data.items(): | ||
| if field not in allowed_fields: | ||
| raise ValidationError({"field": "수정할 수 없는 필드입니다."}) | ||
| setattr(deployment, field, value) |
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.
시리얼라이저의 기본 동작 중에 선언되지 않은 필드에 대해서 키-밸류가 전달되면 해당 데이터는 무시되고 validate를 진행한 후에 validated_data가 생성됩니다
validated_data를 활용한다면 불필요한 절인 것 같아요
| def test_set_status_after_closed(self) -> None: | ||
| deployment = self._create_default_deployment() | ||
| self._force_closed(deployment) | ||
|
|
||
| updated = set_deployment_status( | ||
| deployment=deployment, | ||
| status=DeploymentStatus.DEACTIVATED, | ||
| ) | ||
|
|
||
| self.assertEqual(updated.status, DeploymentStatus.DEACTIVATED) |
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.
요구사항 정의서 보시면 종료된 시험은 상태 변경 불가입니다.
테스트 코드에도 추가하셔서 테스트 진행해주세요
✅ PR 요약
📄 상세 내용
🧪 PR Checklist