summaryrefslogtreecommitdiffstats
path: root/services/attachment/attachment_test.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-11-19 21:39:57 +0800
committerGitHub <noreply@github.com>2021-11-19 21:39:57 +0800
commitfc3d0826096943b979717ed46c9a4cfd86e06106 (patch)
tree3143882ccf4dea3a8bf2a0de9c8da9a4efec26ce /services/attachment/attachment_test.go
parent7a0347315995b25bcb2dca4786504fb699b5f004 (diff)
downloadgitea-fc3d0826096943b979717ed46c9a4cfd86e06106.tar.gz
gitea-fc3d0826096943b979717ed46c9a4cfd86e06106.zip
Move attachment into models/repo/ (#17650)
* Move attachment into models/repo/ * Fix test * Fix bug
Diffstat (limited to 'services/attachment/attachment_test.go')
-rw-r--r--services/attachment/attachment_test.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/services/attachment/attachment_test.go b/services/attachment/attachment_test.go
index 5bb5db11ec..a992fbf151 100644
--- a/services/attachment/attachment_test.go
+++ b/services/attachment/attachment_test.go
@@ -10,6 +10,7 @@ import (
"testing"
"code.gitea.io/gitea/models"
+ repo_model "code.gitea.io/gitea/models/repo"
"code.gitea.io/gitea/models/unittest"
"github.com/stretchr/testify/assert"
@@ -29,14 +30,14 @@ func TestUploadAttachment(t *testing.T) {
assert.NoError(t, err)
defer f.Close()
- attach, err := NewAttachment(&models.Attachment{
+ attach, err := NewAttachment(&repo_model.Attachment{
RepoID: 1,
UploaderID: user.ID,
Name: filepath.Base(fPath),
}, f)
assert.NoError(t, err)
- attachment, err := models.GetAttachmentByUUID(attach.UUID)
+ attachment, err := repo_model.GetAttachmentByUUID(attach.UUID)
assert.NoError(t, err)
assert.EqualValues(t, user.ID, attachment.UploaderID)
assert.Equal(t, int64(0), attachment.DownloadCount)