Skip to content

Commit

Permalink
the querycount is out of control
Browse files Browse the repository at this point in the history
  • Loading branch information
specialunderwear authored and viggo-devries committed May 2, 2024
1 parent 94c032e commit 7079063
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/reverse/test_reallifecase.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from decimal import Decimal as D

from django.core.files import File
from django.db import connection, reset_queries
from django.test import TestCase

from oscar.core.loading import get_model, get_class
Expand Down Expand Up @@ -208,9 +209,10 @@ def test_mapping(self):
# Map the csv resources to product resources
product_resources = CSVProductMapping.apply(products)

# Map the product resources to products and save in DB
_, errors = products_to_db(product_resources)
self.assertEqual(len(errors), 0)
with self.assertNumQueries(10):
# Map the product resources to products and save in DB
_, errors = products_to_db(product_resources)
self.assertEqual(len(errors), 0)

self.assertEqual(Product.objects.all().count(), 59)
self.assertEqual(ProductAttributeValue.objects.all().count(), 257)
Expand Down

0 comments on commit 7079063

Please sign in to comment.