Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Drop unnecessery @pytest.mark.django_db decorators
Pacu217844d86b6aa
diff --git a/tests/conftest.py b/tests/conftest.pyindex 2d027f94ae..65ebc729dc 100644--- a/tests/conftest.py+++ b/tests/conftest.py@@ -655,7 +655,7 @@ def model_form_class():@pytest.fixture-def menu():+def menu(db):# navbar menu object can be already created by default in migrationreturn Menu.objects.get_or_create(name='navbar')[0]diff --git a/tests/dashboard/test_order.py b/tests/dashboard/test_order.pyindex dbf00294fe..c95b5d0382 100644--- a/tests/dashboard/test_order.py+++ b/tests/dashboard/test_order.py@@ -22,7 +22,6 @@ from saleor.product.models import ProductVariant@pytest.mark.integrationdef test_view_capture_order_payment_preauth(admin_client, order_with_lines, payment_preauth):order = order_with_lines@@ -42,7 +41,6 @@ def test_view_capture_order_payment_preauth(@pytest.mark.integrationdef test_view_capture_order_invalid_payment_waiting_status(admin_client, order_with_lines, payment_waiting):order = order_with_lines@@ -59,7 +57,6 @@ def test_view_capture_order_invalid_payment_waiting_status(@pytest.mark.integrationdef test_view_capture_order_invalid_payment_confirmed_status(admin_client, order_with_lines, payment_confirmed):order = order_with_lines@@ -76,7 +73,6 @@ def test_view_capture_order_invalid_payment_confirmed_status(@pytest.mark.integrationdef test_view_capture_order_invalid_payment_rejected_status(admin_client, order_with_lines, payment_rejected):order = order_with_lines@@ -93,7 +89,6 @@ def test_view_capture_order_invalid_payment_rejected_status(@pytest.mark.integrationdef test_view_capture_order_invalid_payment_refunded_status(admin_client, order_with_lines, payment_refunded):order = order_with_lines@@ -110,7 +105,6 @@ def test_view_capture_order_invalid_payment_refunded_status(@pytest.mark.integrationdef test_view_capture_order_invalid_payment_error_status(admin_client, order_with_lines, payment_error):order = order_with_lines@@ -127,7 +121,6 @@ def test_view_capture_order_invalid_payment_error_status(@pytest.mark.integrationdef test_view_capture_order_invalid_payment_input_status(admin_client, order_with_lines, payment_input):order = order_with_lines@@ -144,7 +137,6 @@ def test_view_capture_order_invalid_payment_input_status(@pytest.mark.integrationdef test_view_refund_order_payment_confirmed(admin_client, order_with_lines, payment_confirmed):order = order_with_lines@@ -166,7 +158,6 @@ def test_view_refund_order_payment_confirmed(@pytest.mark.integrationdef test_view_refund_order_invalid_payment_waiting_status(admin_client, order_with_lines, payment_waiting):order = order_with_lines@@ -184,7 +175,6 @@ def test_view_refund_order_invalid_payment_waiting_status(@pytest.mark.integrationdef test_view_refund_order_invalid_payment_preauth_status(admin_client, order_with_lines, payment_preauth):order = order_with_lines@@ -202,7 +192,6 @@ def test_view_refund_order_invalid_payment_preauth_status(@pytest.mark.integrationdef test_view_refund_order_invalid_payment_rejected_status(admin_client, order_with_lines, payment_rejected):order = order_with_lines@@ -220,7 +209,6 @@ def test_view_refund_order_invalid_payment_rejected_status(@pytest.mark.integrationdef test_view_refund_order_invalid_payment_refunded_status(admin_client, order_with_lines, payment_refunded):order = order_with_lines@@ -238,7 +226,6 @@ def test_view_refund_order_invalid_payment_refunded_status(@pytest.mark.integrationdef test_view_refund_order_invalid_payment_error_status(admin_client, order_with_lines, payment_error):order = order_with_lines@@ -256,7 +243,6 @@ def test_view_refund_order_invalid_payment_error_status(@pytest.mark.integrationdef test_view_refund_order_invalid_payment_input_status(admin_client, order_with_lines, payment_input):order = order_with_lines@@ -274,7 +260,6 @@ def test_view_refund_order_invalid_payment_input_status(@pytest.mark.integrationdef test_view_release_order_payment_preauth(admin_client, order_with_lines, payment_preauth):order = order_with_lines@@ -294,7 +279,6 @@ def test_view_release_order_payment_preauth(@pytest.mark.integrationdef test_view_release_order_invalid_payment_waiting_status(admin_client, order_with_lines, payment_waiting):order = order_with_lines@@ -312,7 +296,6 @@ def test_view_release_order_invalid_payment_waiting_status(@pytest.mark.integrationdef test_view_release_order_invalid_payment_confirmed_status(admin_client, order_with_lines, payment_confirmed):order = order_with_lines@@ -330,7 +313,6 @@ def test_view_release_order_invalid_payment_confirmed_status(@pytest.mark.integrationdef test_view_release_order_invalid_payment_rejected_status(admin_client, order_with_lines, payment_rejected):order = order_with_lines@@ -348,7 +330,6 @@ def test_view_release_order_invalid_payment_rejected_status(@pytest.mark.integrationdef test_view_release_order_invalid_payment_refunded_status(admin_client, order_with_lines, payment_refunded):order = order_with_lines@@ -366,7 +347,6 @@ def test_view_release_order_invalid_payment_refunded_status(@pytest.mark.integrationdef test_view_release_order_invalid_payment_error_status(admin_client, order_with_lines, payment_error):order = order_with_lines@@ -384,7 +364,6 @@ def test_view_release_order_invalid_payment_error_status(@pytest.mark.integrationdef test_view_release_order_invalid_payment_input_status(admin_client, order_with_lines, payment_input):order = order_with_lines@@ -402,14 +381,12 @@ def test_view_release_order_invalid_payment_input_status(@pytest.mark.integrationdef test_view_cancel_order_line(admin_client, draft_order):lines_before = draft_order.lines.all()lines_before_count = lines_before.count()line = lines_before.first()line_quantity = line.quantityquantity_allocated_before = line.variant.quantity_allocated- product = line.variant.producturl = reverse('dashboard:orderline-cancel', kwargs={@@ -441,7 +418,6 @@ def test_view_cancel_order_line(admin_client, draft_order):@pytest.mark.integrationdef test_view_change_order_line_quantity(admin_client, draft_order_with_stock):order = draft_order_with_stocklines_before_quantity_change = order.lines.all()@@ -472,7 +448,6 @@ def test_view_change_order_line_quantity(admin_client, draft_order_with_stock):@pytest.mark.integrationdef test_view_change_order_line_quantity_with_invalid_data(admin_client, draft_order):lines = draft_order.lines.all()@@ -543,7 +518,6 @@ def test_ordered_item_change_quantity(transactional_db, order_with_lines):@pytest.mark.integrationdef test_view_order_invoice(admin_client, order_with_lines):url = reverse('dashboard:order-invoice', kwargs={@@ -556,7 +530,6 @@ def test_view_order_invoice(admin_client, order_with_lines):@pytest.mark.integrationdef test_view_order_invoice_without_shipping(admin_client, order_with_lines):order_with_lines.shipping_address.delete()# Regression test for #1536:@@ -568,7 +541,6 @@ def test_view_order_invoice_without_shipping(admin_client, order_with_lines):@pytest.mark.integrationdef test_view_fulfillment_packing_slips(admin_client, fulfilled_order):fulfillment = fulfilled_order.fulfillments.first()url = reverse(@@ -582,7 +554,6 @@ def test_view_fulfillment_packing_slips(admin_client, fulfilled_order):@pytest.mark.integrationdef test_view_fulfillment_packing_slips_without_shipping(admin_client, fulfilled_order):# Regression test for #1536@@ -681,7 +652,6 @@ def test_view_change_fulfillment_tracking(admin_client, fulfilled_order):assert fulfillment.tracking_number == tracking_numberdef test_view_order_create(admin_client):url = reverse('dashboard:order-create')@@ -696,7 +666,6 @@ def test_view_order_create(admin_client):assert order.status == OrderStatus.DRAFTdef test_view_create_from_draft_order_valid(admin_client, draft_order):order = draft_orderurl = reverse(@@ -713,7 +682,6 @@ def test_view_create_from_draft_order_valid(admin_client, draft_order):assert get_redirect_location(response) == redirect_urldef test_view_create_from_draft_order_assigns_customer_email(admin_client, draft_order, customer_user):order = draft_order@@ -729,7 +697,6 @@ def test_view_create_from_draft_order_assigns_customer_email(assert order.user_email == customer_user.emaildef test_view_create_from_draft_order_empty_order(admin_client, draft_order):order = draft_orderorder.lines.all().delete()@@ -746,7 +713,6 @@ def test_view_create_from_draft_order_empty_order(admin_client, draft_order):assert 'Could not create order without any products' in errorsdef test_view_create_from_draft_order_not_draft_order(admin_client, order_with_lines):url = reverse(@@ -759,7 +725,6 @@ def test_view_create_from_draft_order_not_draft_order(assert response.status_code == 404def test_view_create_from_draft_order_shipping_method_not_valid(admin_client, draft_order, shipping_method):method = shipping_method.price_per_country.create(@@ -781,7 +746,6 @@ def test_view_create_from_draft_order_shipping_method_not_valid(assert error in errorsdef test_view_create_from_draft_order_no_shipping_address_shipping_not_required( # noqaadmin_client, draft_order):url = reverse(@@ -799,7 +763,6 @@ def test_view_create_from_draft_order_no_shipping_address_shipping_not_required(assert get_redirect_location(response) == redirect_urldef test_view_order_customer_edit_to_existing_user(admin_client, customer_user, draft_order):draft_order.user = None@@ -824,7 +787,6 @@ def test_view_order_customer_edit_to_existing_user(assert get_redirect_location(response) == redirect_urldef test_view_order_customer_edit_to_email(admin_client, draft_order):url = reverse('dashboard:order-customer-edit', kwargs={'order_pk': draft_order.pk})@@ -843,7 +805,6 @@ def test_view_order_customer_edit_to_email(admin_client, draft_order):assert get_redirect_location(response) == redirect_urldef test_view_order_customer_edit_to_guest_customer(admin_client, draft_order):url = reverse('dashboard:order-customer-edit', kwargs={'order_pk': draft_order.pk})@@ -860,7 +821,6 @@ def test_view_order_customer_edit_to_guest_customer(admin_client, draft_order):assert get_redirect_location(response) == redirect_urldef test_view_order_customer_edit_not_valid(admin_client, customer_user, draft_order):draft_order.user = None@@ -884,7 +844,6 @@ def test_view_order_customer_edit_not_valid(assert error in errorsdef test_view_order_customer_remove(admin_client, draft_order):url = reverse('dashboard:order-customer-remove', kwargs={'order_pk': draft_order.pk})@@ -903,7 +862,6 @@ def test_view_order_customer_remove(admin_client, draft_order):assert not draft_order.shipping_addressdef test_view_order_shipping_edit(admin_client, draft_order, shipping_method, settings):method = shipping_method.price_per_country.create(@@ -924,7 +882,6 @@ def test_view_order_shipping_edit(assert draft_order.shipping_method == methoddef test_view_order_shipping_edit_not_draft_order(admin_client, order_with_lines, shipping_method):method = shipping_method.price_per_country.create(@@ -939,7 +896,6 @@ def test_view_order_shipping_edit_not_draft_order(assert response.status_code == 404def test_view_order_shipping_remove(admin_client, draft_order):url = reverse('dashboard:order-shipping-remove', kwargs={'order_pk': draft_order.pk})@@ -957,7 +913,6 @@ def test_view_order_shipping_remove(admin_client, draft_order):assert draft_order.shipping_price == ZERO_TAXED_MONEYdef test_view_remove_draft_order(admin_client, draft_order):url = reverse('dashboard:draft-order-delete', kwargs={'order_pk': draft_order.pk})@@ -969,7 +924,6 @@ def test_view_remove_draft_order(admin_client, draft_order):assert Order.objects.count() == 0def test_view_remove_draft_order_invalid(admin_client, order_with_lines):url = reverse('dashboard:draft-order-delete',@@ -981,7 +935,6 @@ def test_view_remove_draft_order_invalid(admin_client, order_with_lines):assert Order.objects.count() == 1def test_view_edit_discount(admin_client, draft_order, settings):discount_value = 5total_before = draft_order.totaldiff --git a/tests/dashboard/test_site_settings.py b/tests/dashboard/test_site_settings.pyindex f7cc1170cf..13ed113fcc 100644--- a/tests/dashboard/test_site_settings.py+++ b/tests/dashboard/test_site_settings.py@@ -18,7 +18,6 @@ def test_index_view(admin_client, site_settings):assert context['site'] == site_settingsdef test_site_form():data = {'name': 'mirumee_test', 'domain': 'mirumee_test.com'}form = SiteForm(data)@@ -29,7 +28,6 @@ def test_site_form():assert not form.is_valid()def test_site_settings_form(site_settings):data = {'header_text': 'mirumee', 'description': 'mirumee.com'}form = SiteSettingsForm(data, instance=site_settings)@@ -61,19 +59,16 @@ def test_site_update_view(admin_client, site_settings):assert site_settings.site.name == 'Mirumee Labs'def test_get_authorization_key_for_backend(site_settings, authorization_key):key_for_backend = utils.get_authorization_key_for_backend('Backend')assert key_for_backend == authorization_keydef test_get_authorization_key_no_settings_site(settings, authorization_key):settings.SITE_ID = Noneassert utils.get_authorization_key_for_backend('Backend') is Nonedef test_one_authorization_key_for_backend_and_settings(site_settings, authorization_key):with pytest.raises(IntegrityError):@@ -81,17 +76,14 @@ def test_one_authorization_key_for_backend_and_settings(site_settings=site_settings, name='Backend')def test_authorization_key_key_and_secret(authorization_key):assert authorization_key.key_and_secret() == ('Key', 'Password')def test_settings_available_backends_empty(site_settings):assert site_settings.available_backends().count() == 0def test_settings_available_backends(site_settings, authorization_key):backend_name = authorization_key.nameavailable_backends = site_settings.available_backends()diff --git a/tests/test_asynchronous_tasks.py b/tests/test_asynchronous_tasks.pyindex 60c0533e1e..108a1da99a 100644--- a/tests/test_asynchronous_tasks.py+++ b/tests/test_asynchronous_tasks.py@@ -4,7 +4,6 @@ from saleor.order.emails import (send_order_confirmation, send_payment_confirmation)@pytest.mark.integrationdef test_email_sending_asynchronously(transactional_db, celery_app, celery_worker,diff --git a/tests/test_discounts.py b/tests/test_discounts.pyindex 182350fd9f..e07141ff95 100644--- a/tests/test_discounts.py+++ b/tests/test_discounts.py@@ -174,7 +174,6 @@ def test_products_voucher_checkout_discount_not(assert discount == Money(expected_value, 'USD')def test_sale_applies_to_correct_products(product_type, default_category):product = Product.objects.create(name='Test Product', price=Money(10, 'USD'), description='',