summaryrefslogtreecommitdiffstats
path: root/api4/user_test.go
diff options
context:
space:
mode:
authorDaniel Schalla <daniel@schalla.me>2018-09-03 14:08:40 +0200
committerJesús Espino <jespinog@gmail.com>2018-09-03 14:08:40 +0200
commit531897b1f0d8176c1f983f921f1d1de618db0131 (patch)
tree0f01811eee640141b6a1959ed64a7b250fd59d47 /api4/user_test.go
parent68fdaaa995555e93f067efc3a07f1866e43ae665 (diff)
downloadchat-531897b1f0d8176c1f983f921f1d1de618db0131.tar.gz
chat-531897b1f0d8176c1f983f921f1d1de618db0131.tar.bz2
chat-531897b1f0d8176c1f983f921f1d1de618db0131.zip
add megacheck as makefile target (#9288)
Fix code issues in channel_test.go Fix Channel Test Issues detected by Megacheck Fix API Emoji Test Issues detected by Megacheck Fixed API Issues Reported by Megacheck Fixed App issues reported by megacheck Remaining fixes removed test added by mistake from old HEAD gofmt Store Fixes simplified returns Fix test for multi member channel delete revert to delete unused function
Diffstat (limited to 'api4/user_test.go')
-rw-r--r--api4/user_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/api4/user_test.go b/api4/user_test.go
index 6cd64b7cf..e624d747d 100644
--- a/api4/user_test.go
+++ b/api4/user_test.go
@@ -406,7 +406,7 @@ func TestGetUser(t *testing.T) {
CheckUnauthorizedStatus(t, resp)
// System admins should ignore privacy settings
- ruser, resp = th.SystemAdminClient.GetUser(user.Id, resp.Etag)
+ ruser, _ = th.SystemAdminClient.GetUser(user.Id, resp.Etag)
if ruser.Email == "" {
t.Fatal("email should not be blank")
}
@@ -474,7 +474,7 @@ func TestGetUserByUsername(t *testing.T) {
CheckUnauthorizedStatus(t, resp)
// System admins should ignore privacy settings
- ruser, resp = th.SystemAdminClient.GetUserByUsername(user.Username, resp.Etag)
+ ruser, _ = th.SystemAdminClient.GetUserByUsername(user.Username, resp.Etag)
if ruser.Email == "" {
t.Fatal("email should not be blank")
}
@@ -539,7 +539,7 @@ func TestGetUserByEmail(t *testing.T) {
CheckUnauthorizedStatus(t, resp)
// System admins should ignore privacy settings
- ruser, resp = th.SystemAdminClient.GetUserByEmail(user.Email, resp.Etag)
+ ruser, _ = th.SystemAdminClient.GetUserByEmail(user.Email, resp.Etag)
if ruser.Email == "" {
t.Fatal("email should not be blank")
}
@@ -2208,14 +2208,14 @@ func TestVerifyUserEmail(t *testing.T) {
user := model.User{Email: th.GenerateTestEmail(), Nickname: "Darth Vader", Password: "hello1", Username: GenerateTestUsername(), Roles: model.SYSTEM_ADMIN_ROLE_ID + " " + model.SYSTEM_USER_ROLE_ID}
- ruser, resp := Client.CreateUser(&user)
+ ruser, _ := Client.CreateUser(&user)
token, err := th.App.CreateVerifyEmailToken(ruser.Id)
if err != nil {
t.Fatal("Unable to create email verify token")
}
- _, resp = Client.VerifyUserEmail(token.Token)
+ _, resp := Client.VerifyUserEmail(token.Token)
CheckNoError(t, resp)
_, resp = Client.VerifyUserEmail(GenerateTestId())
@@ -2329,7 +2329,7 @@ func TestCBALogin(t *testing.T) {
}
Client.HttpHeader["X-SSL-Client-Cert-Subject-DN"] = "C=US, ST=Maryland, L=Pasadena, O=Brent Baccala, OU=FreeSoft, CN=www.freesoft.org/emailAddress=" + th.BasicUser.Email
- user, resp = Client.Login(th.BasicUser.Email, "")
+ user, _ = Client.Login(th.BasicUser.Email, "")
if !(user != nil && user.Email == th.BasicUser.Email) {
t.Fatal("Should have been able to login")
}
@@ -2340,13 +2340,13 @@ func TestCBALogin(t *testing.T) {
})
Client.HttpHeader["X-SSL-Client-Cert-Subject-DN"] = "C=US, ST=Maryland, L=Pasadena, O=Brent Baccala, OU=FreeSoft, CN=www.freesoft.org/emailAddress=" + th.BasicUser.Email
- user, resp = Client.Login(th.BasicUser.Email, "")
+ user, _ = Client.Login(th.BasicUser.Email, "")
if resp.Error.StatusCode != 400 && user == nil {
t.Fatal("Should have failed because password is required")
}
Client.HttpHeader["X-SSL-Client-Cert-Subject-DN"] = "C=US, ST=Maryland, L=Pasadena, O=Brent Baccala, OU=FreeSoft, CN=www.freesoft.org/emailAddress=" + th.BasicUser.Email
- user, resp = Client.Login(th.BasicUser.Email, th.BasicUser.Password)
+ user, _ = Client.Login(th.BasicUser.Email, th.BasicUser.Password)
if !(user != nil && user.Email == th.BasicUser.Email) {
t.Fatal("Should have been able to login")
}
@@ -2597,7 +2597,7 @@ func TestGetUserAccessToken(t *testing.T) {
_, resp = AdminClient.GetUserAccessToken(token.Id)
CheckNoError(t, resp)
- token, resp = Client.CreateUserAccessToken(th.BasicUser.Id, testDescription)
+ _, resp = Client.CreateUserAccessToken(th.BasicUser.Id, testDescription)
CheckNoError(t, resp)
rtokens, resp := Client.GetUserAccessTokensForUser(th.BasicUser.Id, 0, 100)