summaryrefslogtreecommitdiffstats
path: root/tests/integration
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2023-11-24 11:49:41 +0800
committerGitHub <noreply@github.com>2023-11-24 03:49:41 +0000
commitdf1e7d0067bb39913eb681ccc920649884fb1938 (patch)
tree2419feab5c28658adb7f71878df646bdc9bdc50e /tests/integration
parentd24a8223ce1e47a0c9b103aae07f67c3112ca048 (diff)
downloadgitea-df1e7d0067bb39913eb681ccc920649884fb1938.tar.gz
gitea-df1e7d0067bb39913eb681ccc920649884fb1938.zip
Use db.Find instead of writing methods for every object (#28084)
For those simple objects, it's unnecessary to write the find and count methods again and again.
Diffstat (limited to 'tests/integration')
-rw-r--r--tests/integration/auth_ldap_test.go2
-rw-r--r--tests/integration/org_count_test.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/integration/auth_ldap_test.go b/tests/integration/auth_ldap_test.go
index 9bb9e7b3c7..1148b3ad39 100644
--- a/tests/integration/auth_ldap_test.go
+++ b/tests/integration/auth_ldap_test.go
@@ -414,7 +414,7 @@ func TestLDAPGroupTeamSyncAddMember(t *testing.T) {
user := unittest.AssertExistsAndLoadBean(t, &user_model.User{
Name: gitLDAPUser.UserName,
})
- usersOrgs, err := organization.FindOrgs(db.DefaultContext, organization.FindOrgOptions{
+ usersOrgs, err := db.Find[organization.Organization](db.DefaultContext, organization.FindOrgOptions{
UserID: user.ID,
IncludePrivate: true,
})
diff --git a/tests/integration/org_count_test.go b/tests/integration/org_count_test.go
index d1aa41963e..6386f53f05 100644
--- a/tests/integration/org_count_test.go
+++ b/tests/integration/org_count_test.go
@@ -118,7 +118,7 @@ func doCheckOrgCounts(username string, orgCounts map[string]int, strict bool, ca
Name: username,
})
- orgs, err := organization.FindOrgs(db.DefaultContext, organization.FindOrgOptions{
+ orgs, err := db.Find[organization.Organization](db.DefaultContext, organization.FindOrgOptions{
UserID: user.ID,
IncludePrivate: true,
})