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

Method SetupSuite

auth/authentication_test.go:27–47  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25}
26
27func (s *AuthenticationSuite) SetupSuite() {
28 mode.Set(mode.TestDev)
29 s.DB = testdb.NewDB(s.T())
30 s.auth = &Auth{s.DB}
31
32 s.DB.CreateUser(&model.User{
33 Name: "existing",
34 Pass: password.CreatePassword("pw", 5),
35 Admin: false,
36 Applications: []model.Application{{Token: "apptoken", Name: "backup server1", Description: "irrelevant"}},
37 Clients: []model.Client{{Token: "clienttoken", Name: "android phone1"}},
38 })
39
40 s.DB.CreateUser(&model.User{
41 Name: "admin",
42 Pass: password.CreatePassword("pw", 5),
43 Admin: true,
44 Applications: []model.Application{{Token: "apptoken_admin", Name: "backup server2", Description: "irrelevant"}},
45 Clients: []model.Client{{Token: "clienttoken_admin", Name: "android phone2"}},
46 })
47}
48
49func (s *AuthenticationSuite) TearDownSuite() {
50 s.DB.Close()

Callers

nothing calls this directly

Calls 4

SetFunction · 0.92
NewDBFunction · 0.92
CreatePasswordFunction · 0.92
CreateUserMethod · 0.65

Tested by

no test coverage detected