summaryrefslogtreecommitdiffstats
path: root/modules/test/context_tests.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/test/context_tests.go')
-rw-r--r--modules/test/context_tests.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/test/context_tests.go b/modules/test/context_tests.go
index f9f0ec5d42..af47369ee1 100644
--- a/modules/test/context_tests.go
+++ b/modules/test/context_tests.go
@@ -45,8 +45,10 @@ func MockContext(t *testing.T, path string) *context.Context {
func LoadRepo(t *testing.T, ctx *context.Context, repoID int64) {
ctx.Repo = &context.Repository{}
ctx.Repo.Repository = models.AssertExistsAndLoadBean(t, &models.Repository{ID: repoID}).(*models.Repository)
- ctx.Repo.RepoLink = ctx.Repo.Repository.Link()
var err error
+ ctx.Repo.Owner, err = models.GetUserByID(ctx.Repo.Repository.OwnerID)
+ assert.NoError(t, err)
+ ctx.Repo.RepoLink = ctx.Repo.Repository.Link()
ctx.Repo.Permission, err = models.GetUserRepoPermission(ctx.Repo.Repository, ctx.User)
assert.NoError(t, err)
}