summaryrefslogtreecommitdiffstats
path: root/integrations/api_token_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'integrations/api_token_test.go')
-rw-r--r--integrations/api_token_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/integrations/api_token_test.go b/integrations/api_token_test.go
index 76660d160f..05b9af7a26 100644
--- a/integrations/api_token_test.go
+++ b/integrations/api_token_test.go
@@ -14,7 +14,7 @@ import (
// TestAPICreateAndDeleteToken tests that token that was just created can be deleted
func TestAPICreateAndDeleteToken(t *testing.T) {
- prepareTestEnv(t)
+ defer prepareTestEnv(t)()
user := models.AssertExistsAndLoadBean(t, &models.User{ID: 1}).(*models.User)
req := NewRequestWithJSON(t, "POST", "/api/v1/users/user1/tokens", map[string]string{
@@ -41,7 +41,7 @@ func TestAPICreateAndDeleteToken(t *testing.T) {
// TestAPIDeleteMissingToken ensures that error is thrown when token not found
func TestAPIDeleteMissingToken(t *testing.T) {
- prepareTestEnv(t)
+ defer prepareTestEnv(t)()
user := models.AssertExistsAndLoadBean(t, &models.User{ID: 1}).(*models.User)
req := NewRequestf(t, "DELETE", "/api/v1/users/user1/tokens/%d", models.NonexistentID)