Skip to content

Добавлен тест на получение отзыва по UUID#10

Open
ValeryEstal wants to merge 1 commit intomainfrom
test_getting_review
Open

Добавлен тест на получение отзыва по UUID#10
ValeryEstal wants to merge 1 commit intomainfrom
test_getting_review

Conversation

@ValeryEstal
Copy link
Copy Markdown
Contributor

Изменения

Детали реализации

Check-List

  • Вы проверили свой код перед отправкой запроса?
  • Вы написали тесты к реализованным функциям?
  • Вы не забыли применить форматирование black и isort для Back-End или Prettier для Front-End?

@ValeryEstal ValeryEstal requested a review from Temmmmmo July 30, 2025 14:57
@ValeryEstal ValeryEstal added the python Pull requests that update python code label Jul 30, 2025
Copy link
Copy Markdown
Member

@Temmmmmo Temmmmmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

очень похоже, что это делалось за 5 минут нейронкой)

Comment on lines +14 to +17
lecturer_data = {
"name": "Иван Иванов",
"email": "ivan@example.com"
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

это работает?)

схема запроса вообще не такая

"email": "ivan@example.com"
}
lecturer_response = requests.post(lecturer_url, json=lecturer_data)
assert lecturer_response.status_code == 201, "Не удалось создать преподавателя"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

201? у нас 200 обычно приходит в нашей системе
ты сваггер смотрела наш?

"rating": 5
}
comment_response = requests.post(comment_url, json=comment_data)
assert comment_response.status_code == 201, "Не удалось создать отзыв"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

201?

# Проверяем значения полей
assert data["uuid"] == comment_uuid
assert data["text"] == "Отличный лектор!"
assert data["rating"] == 5
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

у нас нет таких полей

assert data["rating"] == 5

def test_nonexistent_uuid(self):
url = f"{BASE_URL}/comment/non-existent-uuid"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

что это за запрос
такого запроса нет

assert response.status_code == 422, f"Ожидался статус-код 422, получено {response.status_code}"

def test_public_endpoint(self):
url = f"{BASE_URL}/comment/some-uuid"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

такого запроса тоже нет

from static.settings import get_settings

settings = get_settings()
BASE_URL = settings.BASE_TEST_STAND_URL
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BASE_TEST_STAND_URL разве у нас есть такая переменная в env?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests that update python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants