python3: a number of queries in user export test should be an integer

This commit is contained in:
Paul Marillonnet 2020-02-12 12:24:50 +01:00
parent 8ffbe9480a
commit 5dde723192
1 changed files with 1 additions and 1 deletions

View File

@ -150,7 +150,7 @@ def test_export_csv(settings, app, superuser, django_assert_num_queries):
user_count = User.objects.count()
# queries should be batched to keep prefetching working without
# overspending memory for the queryset cache, 4 queries by batches
num_queries = 4 + 4 * (user_count / DEFAULT_BATCH_SIZE + bool(user_count % DEFAULT_BATCH_SIZE))
num_queries = int(4 + 4 * (user_count / DEFAULT_BATCH_SIZE + bool(user_count % DEFAULT_BATCH_SIZE)))
with django_assert_num_queries(num_queries):
response = response.click('CSV')
table = list(csv.reader(response.text.splitlines()))