diff options
author | Lunny Xiao | 2022-12-24 02:34:51 +0800 |
---|---|---|
committer | GitHub | 2022-12-23 12:34:51 -0600 |
commit | 2b0b56319e94b7173b566af4d082f03664853789 (patch) | |
tree | 6b41dd47e15b4c00a9343224e497e79d534e496f /tests | |
parent | 2cf0cf0de1fc298f1b44a0452c8dbb2c2f9dd71c (diff) |
Improve testing for pgsql empty repository (#22223)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/integration/empty_repo_test.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/integration/empty_repo_test.go b/tests/integration/empty_repo_test.go index 4bc1d811b..1a83de129 100644 --- a/tests/integration/empty_repo_test.go +++ b/tests/integration/empty_repo_test.go @@ -11,6 +11,8 @@ import ( "code.gitea.io/gitea/models/unittest" user_model "code.gitea.io/gitea/models/user" "code.gitea.io/gitea/tests" + + "github.com/stretchr/testify/assert" ) func TestEmptyRepo(t *testing.T) { @@ -21,7 +23,8 @@ func TestEmptyRepo(t *testing.T) { "commit/1ae57b34ccf7e18373", "graph", } - emptyRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{}, unittest.Cond("is_empty = ?", true)) + emptyRepo := unittest.AssertExistsAndLoadBean(t, &repo_model.Repository{ID: 5}) + assert.True(t, emptyRepo.IsEmpty) owner := unittest.AssertExistsAndLoadBean(t, &user_model.User{ID: emptyRepo.OwnerID}) for _, subpath := range subpaths { req := NewRequestf(t, "GET", "/%s/%s/%s", owner.Name, emptyRepo.Name, subpath) |