test(api/v2): defer session close in admin webtest

This commit is contained in:
kolaente 2026-05-31 21:06:26 +02:00 committed by kolaente
parent 2e8bd6724b
commit 730932be13
1 changed files with 1 additions and 1 deletions

View File

@ -42,10 +42,10 @@ func TestHumaAdminProjects(t *testing.T) {
defer license.ResetForTests()
s := db.NewSession()
defer s.Close()
u, err := user.GetUserByID(s, 1)
require.NoError(t, err)
require.False(t, u.IsAdmin, "fixture precondition: user1 is not an admin")
s.Close()
res := adminReq(t, e, http.MethodGet, "/api/v2/admin/projects", u, "")
assert.Equal(t, http.StatusNotFound, res.Code)