mirror of
https://github.com/simon987/task_tracker.git
synced 2025-12-16 00:09:03 +00:00
More work on project permissions
This commit is contained in:
@@ -3,19 +3,28 @@ package test
|
||||
import (
|
||||
"github.com/simon987/task_tracker/api"
|
||||
"github.com/simon987/task_tracker/config"
|
||||
"net/http"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
var testApi *api.WebAPI
|
||||
var testAdminCtx *http.Client
|
||||
var testUserCtx *http.Client
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
|
||||
config.SetupConfig()
|
||||
|
||||
testApi := api.New()
|
||||
testApi = api.New()
|
||||
testApi.SetupLogger()
|
||||
testApi.Database.Reset()
|
||||
go testApi.Run()
|
||||
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
|
||||
testAdminCtx = getSessionCtx("testadmin", "testadmin", true)
|
||||
testUserCtx = getSessionCtx("testuser", "testuser", false)
|
||||
|
||||
m.Run()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user