code.gitea.io/gitea@v1.22.3/models/repo/release_test.go (about) 1 // Copyright 2023 The Gitea Authors. All rights reserved. 2 // SPDX-License-Identifier: MIT 3 4 package repo 5 6 import ( 7 "testing" 8 9 "code.gitea.io/gitea/models/db" 10 "code.gitea.io/gitea/models/unittest" 11 12 "github.com/stretchr/testify/assert" 13 ) 14 15 func TestMigrate_InsertReleases(t *testing.T) { 16 assert.NoError(t, unittest.PrepareTestDatabase()) 17 18 a := &Attachment{ 19 UUID: "a0eebc91-9c0c-4ef7-bb6e-6bb9bd380a12", 20 } 21 r := &Release{ 22 Attachments: []*Attachment{a}, 23 } 24 25 err := InsertReleases(db.DefaultContext, r) 26 assert.NoError(t, err) 27 }