1
0
Fork 0
forked from forgejo/forgejo

Move attachment into models/repo/ (#17650)

* Move attachment into models/repo/

* Fix test

* Fix bug
This commit is contained in:
Lunny Xiao 2021-11-19 21:39:57 +08:00 committed by GitHub
parent 7a03473159
commit fc3d082609
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 477 additions and 414 deletions

View file

@ -11,6 +11,7 @@ import (
"time"
"code.gitea.io/gitea/models"
repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unittest"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/services/attachment"
@ -103,7 +104,7 @@ func TestRelease_Create(t *testing.T) {
IsTag: false,
}, nil, ""))
attach, err := attachment.NewAttachment(&models.Attachment{
attach, err := attachment.NewAttachment(&repo_model.Attachment{
RepoID: repo.ID,
UploaderID: user.ID,
Name: "test.txt",
@ -236,7 +237,7 @@ func TestRelease_Update(t *testing.T) {
assert.Equal(t, tagName, release.TagName)
// Add new attachments
attach, err := attachment.NewAttachment(&models.Attachment{
attach, err := attachment.NewAttachment(&repo_model.Attachment{
RepoID: repo.ID,
UploaderID: user.ID,
Name: "test.txt",