mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-20 00:40:26 +00:00
Honor DEFAULT_PAGING_NUM for API (#11805)
* Honor DEFAULT_PAGING_NUM for API * set pagination to 10 for tests * lint Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
This commit is contained in:
parent
5734524378
commit
cefbf73aea
5 changed files with 16 additions and 15 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
"testing"
|
||||
"time"
|
||||
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/modules/test"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
@ -106,6 +107,12 @@ func TestCreateReleaseDraft(t *testing.T) {
|
|||
func TestCreateReleasePaging(t *testing.T) {
|
||||
defer prepareTestEnv(t)()
|
||||
|
||||
oldAPIDefaultNum := setting.API.DefaultPagingNum
|
||||
defer func() {
|
||||
setting.API.DefaultPagingNum = oldAPIDefaultNum
|
||||
}()
|
||||
setting.API.DefaultPagingNum = 10
|
||||
|
||||
session := loginUser(t, "user2")
|
||||
// Create enaugh releases to have paging
|
||||
for i := 0; i < 12; i++ {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue