From 83f3b51d675bf9e2fb4e2a3ac6dc515d4ccc8ab3 Mon Sep 17 00:00:00 2001 From: kolaente Date: Wed, 17 Jun 2026 13:55:50 +0200 Subject: [PATCH] test(api/v2): use cross-engine datetime literals in testing webtest MariaDB strict mode rejects the RFC3339 T/Z form for DATETIME columns. The space-separated form is accepted by MariaDB, Postgres and SQLite alike; the test only asserts on title and row counts, never the datetime. --- pkg/webtests/huma_testing_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/webtests/huma_testing_test.go b/pkg/webtests/huma_testing_test.go index 4f786c8f1..480ef285f 100644 --- a/pkg/webtests/huma_testing_test.go +++ b/pkg/webtests/huma_testing_test.go @@ -104,7 +104,7 @@ func TestTesting(t *testing.T) { e := setupTestingEnv(t, testingToken) t.Cleanup(func() { _ = db.LoadFixtures() }) - body := `[{"id":1,"title":"only label","created_by_id":1,"created":"2020-01-01T00:00:00Z","updated":"2020-01-01T00:00:00Z"}]` + body := `[{"id":1,"title":"only label","created_by_id":1,"created":"2020-01-01 00:00:00","updated":"2020-01-01 00:00:00"}]` rec := testingRequest(e, http.MethodPut, "/api/v2/test/labels", body, testingToken) require.Equal(t, http.StatusCreated, rec.Code, "body: %s", rec.Body.String()) @@ -122,7 +122,7 @@ func TestTesting(t *testing.T) { before := countRows(t, "labels") require.Positive(t, before, "fixtures should seed some labels") - body := `[{"id":9999,"title":"added label","created_by_id":1,"created":"2020-01-01T00:00:00Z","updated":"2020-01-01T00:00:00Z"}]` + body := `[{"id":9999,"title":"added label","created_by_id":1,"created":"2020-01-01 00:00:00","updated":"2020-01-01 00:00:00"}]` rec := testingRequest(e, http.MethodPut, "/api/v2/test/labels?truncate=false", body, testingToken) require.Equal(t, http.StatusCreated, rec.Code, "body: %s", rec.Body.String())