MCPcopy
hub / github.com/gotify/server / NewDBWithDefaultUser

Function NewDBWithDefaultUser

test/testdb/database.go:32–37  ·  view source on GitHub ↗

NewDBWithDefaultUser creates a new test db instance with the default user.

(t *testing.T)

Source from the content-addressed store, hash-verified

30
31// NewDBWithDefaultUser creates a new test db instance with the default user.
32func NewDBWithDefaultUser(t *testing.T) *Database {
33 db, err := database.New("sqlite3", fmt.Sprintf("file:%s?mode=memory&cache=shared", fmt.Sprint(time.Now().UnixNano())), "admin", "pw", 5, true)
34 assert.Nil(t, err)
35 assert.NotNil(t, db)
36 return &Database{GormDatabase: db, t: t}
37}
38
39// NewDB creates a new test db instance.
40func NewDB(t *testing.T) *Database {

Callers 13

SetupSuiteMethod · 0.92
TestRequirePluginEnabledFunction · 0.92
Test_WithDefaultFunction · 0.92
BeforeTestMethod · 0.92
TestInvalidOriginFunction · 0.92
TestCORSHeaderRegexFunction · 0.92
TestCORSConfigOverrideFunction · 0.92

Calls 1

NewFunction · 0.92

Tested by 13

SetupSuiteMethod · 0.74
TestRequirePluginEnabledFunction · 0.74
Test_WithDefaultFunction · 0.74
BeforeTestMethod · 0.74
TestInvalidOriginFunction · 0.74
TestCORSHeaderRegexFunction · 0.74
TestCORSConfigOverrideFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…