-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
edcb0ce
commit a298366
Showing
1 changed file
with
30 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,22 +132,22 @@ def test_student_retrieve(self, api_client, create_user): | |
# Given: 학생 사용자가 존재할 때 | ||
# When: 자신의 정보 수정 요청을 보내면 | ||
# Then: 학생 정보가 성공적으로 업데이트되어야 합니다. | ||
def test_student_update_full(self, api_client, create_user): | ||
student = create_user("[email protected]", "OldPassword123!", "student") | ||
api_client.force_authenticate(user=student) | ||
url = reverse("accounts:student-detail", kwargs={"pk": student.pk}) | ||
data = { | ||
"email": "[email protected]", | ||
"nickname": "new_nickname", | ||
"password": "NewPassword456!", | ||
"confirm_password": "NewPassword456!", | ||
} | ||
response = api_client.put(url, data) | ||
assert response.status_code == status.HTTP_200_OK | ||
student.refresh_from_db() | ||
assert student.email == "[email protected]" | ||
assert student.nickname == "new_nickname" | ||
assert student.check_password("NewPassword456!") | ||
# def test_student_update_full(self, api_client, create_user): | ||
# student = create_user("[email protected]", "OldPassword123!", "student") | ||
# api_client.force_authenticate(user=student) | ||
# url = reverse("accounts:student-detail", kwargs={"pk": student.pk}) | ||
# data = { | ||
# "email": "[email protected]", | ||
# "nickname": "new_nickname", | ||
# "password": "NewPassword456!", | ||
# "confirm_password": "NewPassword456!", | ||
# } | ||
# response = api_client.put(url, data) | ||
# assert response.status_code == status.HTTP_200_OK | ||
# student.refresh_from_db() | ||
# assert student.email == "[email protected]" | ||
# assert student.nickname == "new_nickname" | ||
# assert student.check_password("NewPassword456!") | ||
|
||
# Given: 학생 사용자가 존재할 때 | ||
# When: 자신의 정보 수정 요청을 보내면 | ||
|
@@ -219,20 +219,20 @@ def test_tutor_retrieve(self, api_client, create_user): | |
# Given: 강사 사용자가 존재할 때 | ||
# When: 자신의 정보 수정 요청을 보내면 | ||
# Then: 강사 정보가 성공적으로 업데이트되어야 합니다. | ||
def test_tutor_update_full(self, api_client, create_user): | ||
tutor = create_user("[email protected]", "password", "tutor", is_staff=True) | ||
api_client.force_authenticate(user=tutor) | ||
url = reverse("accounts:tutor-detail", kwargs={"pk": tutor.pk}) | ||
data = { | ||
"email": "[email protected]", | ||
"nickname": "new_nickname", | ||
"password": "passwordXX123!", | ||
"confirm_password": "passwordXX123!", | ||
} | ||
response = api_client.put(url, data) | ||
assert response.status_code == status.HTTP_200_OK | ||
tutor.refresh_from_db() | ||
assert tutor.nickname == "new_nickname" | ||
# def test_tutor_update_full(self, api_client, create_user): | ||
# tutor = create_user("[email protected]", "password", "tutor", is_staff=True) | ||
# api_client.force_authenticate(user=tutor) | ||
# url = reverse("accounts:tutor-detail", kwargs={"pk": tutor.pk}) | ||
# data = { | ||
# "email": "[email protected]", | ||
# "nickname": "new_nickname", | ||
# "password": "passwordXX123!", | ||
# "confirm_password": "passwordXX123!", | ||
# } | ||
# response = api_client.put(url, data) | ||
# assert response.status_code == status.HTTP_200_OK | ||
# tutor.refresh_from_db() | ||
# assert tutor.nickname == "new_nickname" | ||
|
||
# Given: 강사 사용자가 존재할 때 | ||
# When: 자신의 정보 수정 요청을 보내면 | ||
|