dbtest

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 28, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package dbtest provides database fixtures for Portal Backend tests. Import it only from _test.go files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupMockDB

func SetupMockDB(t *testing.T) (*gorm.DB, sqlmock.Sqlmock, func())

SetupMockDB creates a mock database for testing using go-sqlmock

func SetupSQLiteDB

func SetupSQLiteDB(t *testing.T, models ...any) *gorm.DB

SetupSQLiteDB creates an in-memory SQLite database and migrates the given models into it.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL