LoginDB sets up login credentials in the database for tests
(t *testing.T, db *database.DB)
| 47 | |
| 48 | // LoginDB sets up login credentials in the database for tests |
| 49 | func LoginDB(t *testing.T, db *database.DB) { |
| 50 | database.MustExec(t, "inserting sessionKey", db, "INSERT INTO system (key, value) VALUES (?, ?)", consts.SystemSessionKey, "someSessionKey") |
| 51 | database.MustExec(t, "inserting sessionKeyExpiry", db, "INSERT INTO system (key, value) VALUES (?, ?)", consts.SystemSessionKeyExpiry, time.Now().Add(24*time.Hour).Unix()) |
| 52 | } |
| 53 | |
| 54 | // Login simulates a logged in user by inserting credentials in the local database |
| 55 | func Login(t *testing.T, ctx *context.DnoteCtx) { |