refactor(backend): replace resetTestData with SetupTestDB and add new tests

Migrate all test files from resetTestData(t) to testutils.SetupTestDB(t) for isolated per-package test databases.

- Add new feature tests: name history assertions, referral discount preview,
  time blockers, email validation, GDPR export, loyalty manual redemption
- Update existing tests to use batch queries and SetupTestDB
- Remove test_helpers.go resetTestData infrastructure
- Add comprehensive user profile tests (442 new lines)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
2026-06-20 16:57:36 +01:00
co-authored by Sisyphus
parent 9c68918c20
commit b03c4f6247
36 changed files with 1735 additions and 859 deletions
+2 -1
View File
@@ -8,11 +8,12 @@ import (
"testing"
"crussell/db"
"crussell/testutils"
"crussell/testutils/fixtures"
)
func TestPatchTests_CRUD(t *testing.T) {
resetTestData(t)
testutils.SetupTestDB(t)
// Create a service to link
serviceID, err := fixtures.CreateTestService(db.DB)