fix linting

This commit is contained in:
2025-09-10 12:33:33 +02:00
parent f5c04f9d58
commit f425673953
6 changed files with 29 additions and 30 deletions

View File

@@ -15,4 +15,4 @@ def test_home_url():
""" test the home url """
url = reverse('index')
assert resolve(url).view_name == 'index'
assert resolve(url).func, index()
assert resolve(url).func, index()

View File

@@ -7,4 +7,4 @@ def test_view_should_reply_title_on_home():
c = Client()
url = reverse('index')
response = c.get(url)
assert "Welcome to Holiday Homes</h1>" in response.content.decode()
assert "Welcome to Holiday Homes</h1>" in response.content.decode()

View File

@@ -6,12 +6,11 @@ from profiles.models import Profile
@pytest.mark.django_db
def test_str_profile():
user = User.objects.create(
username = 'TestUser',
password = 'password',
username='TestUser',
password='password',
)
profile = Profile.objects.create(
user=user,
favorite_city="Paris",
)
assert str(profile) == "TestUser"

View File

@@ -11,6 +11,7 @@ def test_should_get_200_on_profile_index():
response = c.get(url)
assert response.status_code == 200
@pytest.mark.django_db
def test_should_get_200_on_profile_detail(sample_profile):
""" test the server's response on a profile detail page """
@@ -18,4 +19,3 @@ def test_should_get_200_on_profile_detail(sample_profile):
url = reverse('profile', kwargs={'username': "TestUser"})
response = c.get(url)
assert response.status_code == 200

View File

@@ -3,6 +3,7 @@ from django.test import Client
from django.urls import reverse
from bs4 import BeautifulSoup
@pytest.mark.django_db
def test_view_should_display_right_len_list(sample_profile):
"""
@@ -15,4 +16,3 @@ def test_view_should_display_right_len_list(sample_profile):
soup = BeautifulSoup(response.content, 'html.parser')
li_tags = soup.find_all('li')
assert len(li_tags) == 3