Skip to content

Commit

Permalink
add numqueries test to increases
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienReuiller committed Aug 23, 2023
1 parent db21a36 commit bad0bed
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lemarche/www/siaes/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,19 @@ def test_search_should_return_live_siaes(self):
self.assertEqual(len(siaes), 1)


class SiaeSearchNumQueriesTest(TestCase):
@classmethod
def setUpTestData(cls):
SiaeFactory.create_batch(30)

def test_search_num_queries(self):
url = reverse("siae:search_results")
with self.assertNumQueries(8):
response = self.client.get(url)
siaes = list(response.context["siaes"])
self.assertEqual(len(siaes), 20)


class SiaeKindSearchFilterTest(TestCase):
@classmethod
def setUpTestData(cls):
Expand Down

0 comments on commit bad0bed

Please sign in to comment.