From 7ed011745a544873f40f806f1803cb8a4998ba01 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 26 Oct 2017 14:21:22 -0500 Subject: Remove more global refs / state (#7723) * remove more global refs / state * fix job enterprise initialization * fix api4 test compilation * saml api endpoints fix --- api4/user_test.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'api4/user_test.go') diff --git a/api4/user_test.go b/api4/user_test.go index eee9aa8a2..5424a1ee2 100644 --- a/api4/user_test.go +++ b/api4/user_test.go @@ -10,7 +10,6 @@ import ( "testing" "time" - "github.com/mattermost/mattermost-server/app" "github.com/mattermost/mattermost-server/model" "github.com/mattermost/mattermost-server/utils" "github.com/stretchr/testify/assert" @@ -961,7 +960,7 @@ func TestUpdateUser(t *testing.T) { session, _ := th.App.GetSession(Client.AuthToken) session.IsOAuth = true - app.AddSessionToCache(session) + th.App.AddSessionToCache(session) ruser.Id = user.Id ruser.Email = GenerateTestEmail() @@ -1045,7 +1044,7 @@ func TestPatchUser(t *testing.T) { session, _ := th.App.GetSession(Client.AuthToken) session.IsOAuth = true - app.AddSessionToCache(session) + th.App.AddSessionToCache(session) patch.Email = model.NewString(GenerateTestEmail()) _, resp = Client.PatchUser(user.Id, patch) @@ -1513,7 +1512,7 @@ func TestUpdateUserMfa(t *testing.T) { session, _ := th.App.GetSession(Client.AuthToken) session.IsOAuth = true - app.AddSessionToCache(session) + th.App.AddSessionToCache(session) _, resp := Client.UpdateUserMfa(th.BasicUser.Id, "12345", false) CheckForbiddenStatus(t, resp) @@ -1609,7 +1608,7 @@ func TestGenerateMfaSecret(t *testing.T) { session, _ := th.App.GetSession(Client.AuthToken) session.IsOAuth = true - app.AddSessionToCache(session) + th.App.AddSessionToCache(session) _, resp = Client.GenerateMfaSecret(th.BasicUser.Id) CheckForbiddenStatus(t, resp) @@ -2257,7 +2256,7 @@ func TestCreateUserAccessToken(t *testing.T) { session, _ := th.App.GetSession(Client.AuthToken) session.IsOAuth = true - app.AddSessionToCache(session) + th.App.AddSessionToCache(session) _, resp = Client.CreateUserAccessToken(th.BasicUser.Id, testDescription) CheckForbiddenStatus(t, resp) -- cgit v1.2.3-1-g7c22