Skip to content

Commit 50e8f92

Browse files
committed
unique token for each test
1 parent ff2125c commit 50e8f92

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

integrations/integration_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,18 @@ func loginUserWithPassword(t testing.TB, userName, password string) *TestSession
330330
return session
331331
}
332332

333+
//token has to be unique this counter take care of
334+
var tokenCounter int64
335+
333336
func getTokenForLoggedInUser(t testing.TB, session *TestSession) string {
334337
t.Helper()
338+
tokenCounter += 1
335339
req := NewRequest(t, "GET", "/user/settings/applications")
336340
resp := session.MakeRequest(t, req, http.StatusOK)
337341
doc := NewHTMLParser(t, resp.Body)
338342
req = NewRequestWithValues(t, "POST", "/user/settings/applications", map[string]string{
339343
"_csrf": doc.GetCSRF(),
340-
"name": "api-testing-token",
344+
"name": fmt.Sprintf("api-testing-token-%d", tokenCounter),
341345
})
342346
resp = session.MakeRequest(t, req, http.StatusFound)
343347
req = NewRequest(t, "GET", "/user/settings/applications")

0 commit comments

Comments
 (0)