debian: set TENANT_LIMIT_SET_CALLS (#84710)
gitea/hobo/pipeline/head There was a failure building this commit Details

This commit is contained in:
Frédéric Péters 2023-12-14 09:09:06 +01:00
parent c0bba7ceb4
commit 2052668f72
2 changed files with 4 additions and 3 deletions

View File

@ -305,6 +305,7 @@ if PROJECT_NAME != 'wcs':
TENANT_BASE = os.path.join(VAR_DIR, 'tenants')
TENANT_MODEL = 'multitenant.Tenant'
TENANT_LIMIT_SET_CALLS = True
MIDDLEWARE = (
'hobo.multitenant.middleware.TenantMiddleware',

View File

@ -242,7 +242,7 @@ def test_hobo_notify_roles_db_queries(caplog, tenants):
}
with CaptureQueriesContext(connection) as ctx:
Command.process_notification(tenant, notification)
assert len(ctx.captured_queries) == 33
assert len(ctx.captured_queries) == 13
assert Group.objects.count() == 2
assert Role.objects.count() == 2
@ -267,7 +267,7 @@ def test_hobo_notify_roles_db_queries(caplog, tenants):
}
with CaptureQueriesContext(connection) as ctx:
Command.process_notification(tenant, notification)
assert len(ctx.captured_queries) == 36
assert len(ctx.captured_queries) == 14
assert Group.objects.count() == 1
assert Role.objects.count() == 1
@ -337,7 +337,7 @@ def test_hobo_notify_roles_db_queries(caplog, tenants):
}
with CaptureQueriesContext(connection) as ctx:
Command.process_notification(tenant, notification)
assert len(ctx.captured_queries) == 18
assert len(ctx.captured_queries) == 8
assert Group.objects.count() == 0
assert Role.objects.count() == 0