Coverage for cheese/cheeses/tests/test_models.py: 100.00%
10 statements
« prev ^ index » next coverage.py v7.17.5, created at 2026-11-23 08:46 -0800
« prev ^ index » next coverage.py v7.17.5, created at 2026-11-23 08:46 -0800
1import pytest 1a
3# from ..models import Cheese
4from .factories import CheeseFactory 1a
6# Connects our tests with our database
7pytestmark = pytest.mark.django_db 1a
10def test__str__(): 1a
11 cheese = CheeseFactory() 1a
12 assert str(cheese) == cheese.name 1a
15def test_get_absolute_url(): 1a
16 cheese = CheeseFactory() 1a
17 url = cheese.get_absolute_url() 1a
18 assert url == f"/cheeses/{cheese.slug}/" 1a