mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-18 22:57:38 +01:00
modify test code
This commit is contained in:
parent
eb62beba31
commit
9f16403a22
@ -689,7 +689,7 @@ func TestDeleteProjectMember(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestToggleAdminRole(t *testing.T) {
|
func TestToggleAdminRole(t *testing.T) {
|
||||||
err := ToggleUserAdminRole(*currentUser)
|
err := ToggleUserAdminRole(currentUser.UserID, 1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Error in toggle ToggleUserAdmin role: %v, user: %+v", err, currentUser)
|
t.Errorf("Error in toggle ToggleUserAdmin role: %v, user: %+v", err, currentUser)
|
||||||
}
|
}
|
||||||
@ -700,7 +700,7 @@ func TestToggleAdminRole(t *testing.T) {
|
|||||||
if !isAdmin {
|
if !isAdmin {
|
||||||
t.Errorf("User is not admin after toggled, user id: %d", currentUser.UserID)
|
t.Errorf("User is not admin after toggled, user id: %d", currentUser.UserID)
|
||||||
}
|
}
|
||||||
err = ToggleUserAdminRole(*currentUser)
|
err = ToggleUserAdminRole(currentUser.UserID, 0)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("Error in toggle ToggleUserAdmin role: %v, user: %+v", err, currentUser)
|
t.Errorf("Error in toggle ToggleUserAdmin role: %v, user: %+v", err, currentUser)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user