summaryrefslogtreecommitdiffstats
path: root/services/release/release_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'services/release/release_test.go')
-rw-r--r--services/release/release_test.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/services/release/release_test.go b/services/release/release_test.go
index 9f665fabab..936f2ab71c 100644
--- a/services/release/release_test.go
+++ b/services/release/release_test.go
@@ -12,6 +12,7 @@ import (
"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/git"
+ "code.gitea.io/gitea/services/attachment"
"github.com/stretchr/testify/assert"
)
@@ -101,10 +102,11 @@ func TestRelease_Create(t *testing.T) {
IsTag: false,
}, nil, ""))
- attach, err := models.NewAttachment(&models.Attachment{
+ attach, err := attachment.NewAttachment(&models.Attachment{
+ RepoID: repo.ID,
UploaderID: user.ID,
Name: "test.txt",
- }, []byte{}, strings.NewReader("testtest"))
+ }, strings.NewReader("testtest"))
assert.NoError(t, err)
var release = models.Release{
@@ -233,10 +235,11 @@ func TestRelease_Update(t *testing.T) {
assert.Equal(t, tagName, release.TagName)
// Add new attachments
- attach, err := models.NewAttachment(&models.Attachment{
+ attach, err := attachment.NewAttachment(&models.Attachment{
+ RepoID: repo.ID,
UploaderID: user.ID,
Name: "test.txt",
- }, []byte{}, strings.NewReader("testtest"))
+ }, strings.NewReader("testtest"))
assert.NoError(t, err)
assert.NoError(t, UpdateRelease(user, gitRepo, release, []string{attach.UUID}, nil, nil))