From f856f1756d386b0bcf6f485da046035818e48056 Mon Sep 17 00:00:00 2001 From: Jan Gregorczyk Date: Sun, 10 Mar 2024 18:28:43 +0100 Subject: [PATCH] test: removed unused imports, fixed fixture decorator --- Dshop/apps/products_catalogue/tests/conftest.py | 2 -- Dshop/apps/products_catalogue/tests/test_api_products.py | 2 +- Dshop/conftest.py | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Dshop/apps/products_catalogue/tests/conftest.py b/Dshop/apps/products_catalogue/tests/conftest.py index de16e16..a596187 100644 --- a/Dshop/apps/products_catalogue/tests/conftest.py +++ b/Dshop/apps/products_catalogue/tests/conftest.py @@ -1,7 +1,5 @@ import datetime -from django.contrib.auth.models import User import pytest -from rest_framework.test import APIClient from apps.products_catalogue.models import Category, Product diff --git a/Dshop/apps/products_catalogue/tests/test_api_products.py b/Dshop/apps/products_catalogue/tests/test_api_products.py index 24f4728..dcbf775 100644 --- a/Dshop/apps/products_catalogue/tests/test_api_products.py +++ b/Dshop/apps/products_catalogue/tests/test_api_products.py @@ -2,7 +2,7 @@ import pytest from django.urls import reverse from django.conf import settings -from apps.products_catalogue.models import Category, Product, ProductImage +from apps.products_catalogue.models import ProductImage from PIL import Image from django.core.files.uploadedfile import SimpleUploadedFile import tempfile diff --git a/Dshop/conftest.py b/Dshop/conftest.py index 774f4c2..cbf8ab7 100644 --- a/Dshop/conftest.py +++ b/Dshop/conftest.py @@ -57,7 +57,7 @@ def tv_product(): return product -@pytest.pytest.fixture +@pytest.fixture def inactive_product(): category = Category.objects.create(name='Test Category 2', is_active=True) return Product.objects.create(