Skip to content

Commit

Permalink
User tests: Fix error if anonymous is does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
Nosmoht committed Jan 24, 2020
1 parent 32f8dbd commit 5c2eac5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,12 @@ func TestUserDeleteCurrentlySignedInUser(t *testing.T) {
func TestUserDeleteAnonymous(t *testing.T) {
client := NewClient(getDefaultConfig())

err := client.UserDelete("anonymous")
assert.NotNil(t, err)
assert.Contains(t, err.Error(), "Can not delete anonymous user")
anonymous, err := client.UserRead("anonymous")
assert.Nil(t, err)

if anonymous != nil {
err = client.UserDelete("anonymous")
assert.NotNil(t, err)
assert.Contains(t, err.Error(), "Can not delete anonymous user")
}
}

0 comments on commit 5c2eac5

Please sign in to comment.