fix for testing export of issues

pull/35313/head
Timotheus Pokorra 2025-12-09 15:53:34 +07:00
parent 056a0d6c65
commit 0a93b9ed34
1 changed files with 2 additions and 2 deletions

@ -381,7 +381,7 @@ func TestIssueListExport(t *testing.T) {
_ = testNewIssue(t, session, "user2", "repo1", "Title3", "Description3")
// trying to export all open issues of the given repository
req := NewRequestWithValues(t, "GET", fmt.Sprintf("/%s/%s/issues/export?%s", "user2", "repo1", "type=all&state=open"))
req := NewRequest(t, "GET", fmt.Sprintf("/%s/%s/issues/export?%s", "user2", "repo1", "type=all&state=open"))
resp := session.MakeRequest(t, req, http.StatusOK)
// Content-Type should be an Excel file (XLSX)
@ -391,7 +391,7 @@ func TestIssueListExport(t *testing.T) {
// Content-Disposition should indicate attachment with .xlsx
cd := resp.Header().Get("Content-Disposition")
assert.Contains(t, cd, "attachment")
assert.True(t, strings.Contains(cd, ".xlsx"))
assert.Contains(t, cd, ".xlsx")
// open bytes as XLSX with excelize
data := resp.Body.Bytes()