diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-12-12 20:45:21 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-12 20:45:21 +0800 |
commit | 36a2d2f919ee445f0374c210309b336e7c3c1f8e (patch) | |
tree | 05163a55f16f3e62ab9e3757e5ada977e1fdd6da /models | |
parent | 6398ca745aabdc40f10465e71da99c5a3866990e (diff) | |
download | gitea-36a2d2f919ee445f0374c210309b336e7c3c1f8e.tar.gz gitea-36a2d2f919ee445f0374c210309b336e7c3c1f8e.zip |
Add a simple test for external renderer (#20033)
Fix #16402
Diffstat (limited to 'models')
-rw-r--r-- | models/db/iterate_test.go | 2 | ||||
-rw-r--r-- | models/fixtures/repo_unit.yml | 6 | ||||
-rw-r--r-- | models/fixtures/repository.yml | 27 | ||||
-rw-r--r-- | models/fixtures/user.yml | 2 | ||||
-rw-r--r-- | models/repo/repo_list_test.go | 6 |
5 files changed, 38 insertions, 5 deletions
diff --git a/models/db/iterate_test.go b/models/db/iterate_test.go index b0ea8b53ef..57b1bd3cd1 100644 --- a/models/db/iterate_test.go +++ b/models/db/iterate_test.go @@ -25,7 +25,7 @@ func TestIterate(t *testing.T) { return nil }) assert.NoError(t, err) - assert.EqualValues(t, 79, repoCnt) + assert.EqualValues(t, 80, repoCnt) err = db.Iterate(db.DefaultContext, nil, func(ctx context.Context, repoUnit *repo_model.RepoUnit) error { reopUnit2 := repo_model.RepoUnit{ID: repoUnit.ID} diff --git a/models/fixtures/repo_unit.yml b/models/fixtures/repo_unit.yml index 59ab618340..73db47218b 100644 --- a/models/fixtures/repo_unit.yml +++ b/models/fixtures/repo_unit.yml @@ -544,3 +544,9 @@ repo_id: 51 type: 2 created_unix: 946684810 + +- + id: 80 + repo_id: 53 + type: 1 + created_unix: 946684810 diff --git a/models/fixtures/repository.yml b/models/fixtures/repository.yml index f09953be7e..a5a3dd0601 100644 --- a/models/fixtures/repository.yml +++ b/models/fixtures/repository.yml @@ -1558,3 +1558,30 @@ size: 0 is_fsck_enabled: true close_issues_via_commit_in_any_branch: false + +- + id: 53 + owner_id: 30 + owner_name: user30 + lower_name: renderer + name: renderer + is_archived: false + is_empty: false + is_private: false + num_issues: 0 + num_closed_issues: 0 + num_pulls: 0 + num_closed_pulls: 0 + num_milestones: 0 + num_closed_milestones: 0 + num_watches: 0 + num_projects: 0 + num_closed_projects: 0 + status: 0 + is_fork: false + fork_id: 0 + is_template: false + template_id: 0 + size: 0 + is_fsck_enabled: true + close_issues_via_commit_in_any_branch: false diff --git a/models/fixtures/user.yml b/models/fixtures/user.yml index 0e3348e146..1b870e8999 100644 --- a/models/fixtures/user.yml +++ b/models/fixtures/user.yml @@ -1102,7 +1102,7 @@ num_followers: 0 num_following: 0 num_stars: 0 - num_repos: 3 + num_repos: 4 num_teams: 0 num_members: 0 visibility: 0 diff --git a/models/repo/repo_list_test.go b/models/repo/repo_list_test.go index bfbceb7e2e..d87d70c189 100644 --- a/models/repo/repo_list_test.go +++ b/models/repo/repo_list_test.go @@ -235,12 +235,12 @@ func TestSearchRepository(t *testing.T) { { name: "AllPublic/PublicRepositoriesOfUserIncludingCollaborative", opts: &repo_model.SearchRepoOptions{ListOptions: db.ListOptions{Page: 1, PageSize: 10}, OwnerID: 15, AllPublic: true, Template: util.OptionalBoolFalse}, - count: 28, + count: 29, }, { name: "AllPublic/PublicAndPrivateRepositoriesOfUserIncludingCollaborative", opts: &repo_model.SearchRepoOptions{ListOptions: db.ListOptions{Page: 1, PageSize: 10}, OwnerID: 15, Private: true, AllPublic: true, AllLimited: true, Template: util.OptionalBoolFalse}, - count: 33, + count: 34, }, { name: "AllPublic/PublicAndPrivateRepositoriesOfUserIncludingCollaborativeByName", @@ -255,7 +255,7 @@ func TestSearchRepository(t *testing.T) { { name: "AllPublic/PublicRepositoriesOfOrganization", opts: &repo_model.SearchRepoOptions{ListOptions: db.ListOptions{Page: 1, PageSize: 10}, OwnerID: 17, AllPublic: true, Collaborate: util.OptionalBoolFalse, Template: util.OptionalBoolFalse}, - count: 28, + count: 29, }, { name: "AllTemplates", |