Skip to content

Commit 292c787

Browse files
committed
fix test
1 parent 61f3b4b commit 292c787

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

services/repository/transfer_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,28 @@
55
package repository
66

77
import (
8+
"sync"
89
"testing"
910

1011
"code.gitea.io/gitea/models"
12+
"code.gitea.io/gitea/modules/notification"
13+
"code.gitea.io/gitea/modules/notification/action"
1114

1215
"github.com/stretchr/testify/assert"
1316
"github.com/unknwon/com"
1417
)
1518

19+
var notifySync sync.Once
20+
21+
func registerNotifier() {
22+
notifySync.Do(func() {
23+
notification.RegisterNotifier(action.NewNotifier())
24+
})
25+
}
26+
1627
func TestTransferOwnership(t *testing.T) {
28+
registerNotifier()
29+
1730
assert.NoError(t, models.PrepareTestDatabase())
1831

1932
doer := models.AssertExistsAndLoadBean(t, &models.User{ID: 2}).(*models.User)

0 commit comments

Comments
 (0)