add docstrings

This commit is contained in:
2025-09-09 16:32:32 +02:00
parent aca7042c56
commit 286f1cb57b
5 changed files with 13 additions and 7 deletions

View File

@@ -5,7 +5,7 @@ from django.test import Client
@pytest.mark.django_db
def test_should_get_200_on_profile_index():
""" test the server's response """
""" test the server's response on profile index page """
c = Client()
url = reverse('profiles_index')
response = c.get(url)
@@ -13,6 +13,7 @@ def test_should_get_200_on_profile_index():
@pytest.mark.django_db
def test_should_get_200_on_profile_detail(sample_profile):
""" test the server's response on a profile detail page """
c = Client()
url = reverse('profile', kwargs={'username': "TestUser"})
response = c.get(url)

View File

@@ -5,9 +5,14 @@ from bs4 import BeautifulSoup
@pytest.mark.django_db
def test_view_should_display_right_len_list(sample_profile):
"""
test that html page displays the right amount of objects
created by fixture
"""
c = Client()
url = reverse('profiles_index')
response = c.get(url)
soup = BeautifulSoup(response.content, 'html.parser')
li_tags = soup.find_all('li')
assert len(li_tags) == 3
assert len(li_tags) == 3