From 7b5ca126ee37cd386d9900b2ef29901debb28e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anssi=20K=C3=A4=C3=A4ri=C3=A4inen?= Date: Sun, 10 Feb 2013 21:07:24 +0200 Subject: [PATCH] [1.5.x] Fixed #19112 -- Reduced the amount of query params in a test Backpatch of 604d8763dc2c901a3557e15880895d88af5c4127. --- tests/regressiontests/queries/tests.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/regressiontests/queries/tests.py b/tests/regressiontests/queries/tests.py index 1d453f580a..a6bd2436c1 100644 --- a/tests/regressiontests/queries/tests.py +++ b/tests/regressiontests/queries/tests.py @@ -1881,8 +1881,10 @@ class ConditionalTests(BaseQuerysetTest): @skipUnlessDBFeature('supports_1000_query_parameters') def test_ticket14244(self): # Test that the "in" lookup works with lists of 1000 items or more. + # The numbers amount is picked to force three different IN batches + # for Oracle, yet to be less than 2100 parameter limit for MSSQL. + numbers = range(2050) Number.objects.all().delete() - numbers = range(2500) Number.objects.bulk_create(Number(num=num) for num in numbers) self.assertEqual( Number.objects.filter(num__in=numbers[:1000]).count(), @@ -1898,7 +1900,7 @@ class ConditionalTests(BaseQuerysetTest): ) self.assertEqual( Number.objects.filter(num__in=numbers).count(), - 2500 + len(numbers) )