()
| 25 | } |
| 26 | |
| 27 | func (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 | |
| 49 | func (s *AuthenticationSuite) TearDownSuite() { |
| 50 | s.DB.Close() |
nothing calls this directly
no test coverage detected