response.content.decode() => response.text

This commit is contained in:
Thomas Girod
2025-04-11 14:41:22 +02:00
parent ad4afce67f
commit 805ffc498f
6 changed files with 33 additions and 33 deletions

View File

@ -20,7 +20,7 @@ def test_page_display_on_club_main_page(client: Client):
res = client.get(reverse("club:club_view", kwargs={"club_id": club.id}))
assert res.status_code == 200
soup = BeautifulSoup(res.content.decode(), "lxml")
soup = BeautifulSoup(res.text, "lxml")
detail_html = soup.find(id="club_detail").find(class_="markdown")
assertHTMLEqual(detail_html.decode_contents(), markdown(content))
@ -34,6 +34,6 @@ def test_club_main_page_without_content(client: Client):
res = client.get(reverse("club:club_view", kwargs={"club_id": club.id}))
assert res.status_code == 200
soup = BeautifulSoup(res.content.decode(), "lxml")
soup = BeautifulSoup(res.text, "lxml")
detail_html = soup.find(id="club_detail")
assert detail_html.find_all("markdown") == []