Login simulates a logged in user by inserting credentials in the local database
(t *testing.T, ctx *context.DnoteCtx)
| 53 | |
| 54 | // Login simulates a logged in user by inserting credentials in the local database |
| 55 | func Login(t *testing.T, ctx *context.DnoteCtx) { |
| 56 | LoginDB(t, ctx.DB) |
| 57 | |
| 58 | ctx.SessionKey = "someSessionKey" |
| 59 | ctx.SessionKeyExpiry = time.Now().Add(24 * time.Hour).Unix() |
| 60 | } |
| 61 | |
| 62 | // RemoveDir cleans up the test env represented by the given context |
| 63 | func RemoveDir(t *testing.T, dir string) { |