From 3b8ebd6454d6e5b8fd41b13bb5e6052e1ee696d2 Mon Sep 17 00:00:00 2001 From: Stephan Kerkman Date: Thu, 28 May 2026 21:42:49 +0200 Subject: [PATCH] style: move PlantCardPhoto import to module level in test_models --- plants/tests/test_models.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plants/tests/test_models.py b/plants/tests/test_models.py index 60e262a..5c06163 100644 --- a/plants/tests/test_models.py +++ b/plants/tests/test_models.py @@ -1,5 +1,5 @@ import pytest -from plants.models import Species, Plant, PruningLog, Location +from plants.models import Species, Plant, PruningLog, Location, PlantCardPhoto from datetime import date @@ -57,7 +57,6 @@ def test_delete_species_nulls_plant_species(): @pytest.mark.django_db def test_card_photo_belongs_to_plant(): - from plants.models import PlantCardPhoto plant = Plant.objects.create(name='Test') photo = PlantCardPhoto.objects.create(plant=plant, image='plants/cards/test.jpg') assert photo.plant == plant @@ -65,7 +64,6 @@ def test_card_photo_belongs_to_plant(): @pytest.mark.django_db def test_card_photos_ordered_by_uploaded_at(): - from plants.models import PlantCardPhoto plant = Plant.objects.create(name='Test') p1 = PlantCardPhoto.objects.create(plant=plant, image='plants/cards/a.jpg') p2 = PlantCardPhoto.objects.create(plant=plant, image='plants/cards/b.jpg') @@ -76,7 +74,6 @@ def test_card_photos_ordered_by_uploaded_at(): @pytest.mark.django_db def test_card_photos_deleted_with_plant(): - from plants.models import PlantCardPhoto plant = Plant.objects.create(name='Test') PlantCardPhoto.objects.create(plant=plant, image='plants/cards/test.jpg') plant.delete()