Skip to content

Commit

Permalink
feat ⭐ update query count
Browse files Browse the repository at this point in the history
  • Loading branch information
samar-hassan committed May 2, 2024
1 parent 18a7438 commit e88c7b6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/reverse/test_reallifecase.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def test_mapping(self):
# Map the csv resources to product resources
product_resources = CSVProductMapping.apply(products)

with self.assertNumQueries(59 * 4 + 10):
with self.assertNumQueries(59 * 20 + 12):
# Map the product resources to products and save in DB
_, errors = products_to_db(product_resources)
self.assertEqual(len(errors), 0)
Expand All @@ -225,9 +225,9 @@ def test_mapping(self):
# The seocnd time, the querycount should be lower
product_resources_2 = CSVProductMapping.apply(products_2)

with self.assertNumQueries(59 + 10):
with self.assertNumQueries(59 * 3 + 15):
# Map the product resources to products and save in DB
_, errors = products_to_db(product_resources_2)
_, errors = products_to_db(product_resources_2, clean_instances=False)
self.assertEqual(len(errors), 0)

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

0 comments on commit e88c7b6

Please sign in to comment.