diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-06-18 15:59:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-18 09:59:09 +0200 |
commit | 4e2f1ee58d1aa49f85c3a28a4f96e915f12bdb21 (patch) | |
tree | e2751e1c4673f6a051ef04ca156f428a819fdb66 /routers/web/user/home_test.go | |
parent | fc2115b494e9ba7e4cf7a1440404dce53738b514 (diff) | |
download | gitea-4e2f1ee58d1aa49f85c3a28a4f96e915f12bdb21.tar.gz gitea-4e2f1ee58d1aa49f85c3a28a4f96e915f12bdb21.zip |
Refactor web package and context package (#25298)
1. The "web" package shouldn't depends on "modules/context" package,
instead, let each "web context" register themselves to the "web"
package.
2. The old Init/Free doesn't make sense, so simplify it
* The ctx in "Init(ctx)" is never used, and shouldn't be used that way
* The "Free" is never called and shouldn't be called because the SSPI
instance is shared
---------
Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'routers/web/user/home_test.go')
-rw-r--r-- | routers/web/user/home_test.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/routers/web/user/home_test.go b/routers/web/user/home_test.go index 534b0b2620..3a06a38c24 100644 --- a/routers/web/user/home_test.go +++ b/routers/web/user/home_test.go @@ -20,7 +20,7 @@ func TestArchivedIssues(t *testing.T) { setting.UI.IssuePagingNum = 1 assert.NoError(t, unittest.LoadFixtures()) - ctx := test.MockContext(t, "issues") + ctx, _ := test.MockContext(t, "issues") test.LoadUser(t, ctx, 30) ctx.Req.Form.Set("state", "open") @@ -53,7 +53,7 @@ func TestIssues(t *testing.T) { setting.UI.IssuePagingNum = 1 assert.NoError(t, unittest.LoadFixtures()) - ctx := test.MockContext(t, "issues") + ctx, _ := test.MockContext(t, "issues") test.LoadUser(t, ctx, 2) ctx.Req.Form.Set("state", "closed") Issues(ctx) @@ -69,7 +69,7 @@ func TestPulls(t *testing.T) { setting.UI.IssuePagingNum = 20 assert.NoError(t, unittest.LoadFixtures()) - ctx := test.MockContext(t, "pulls") + ctx, _ := test.MockContext(t, "pulls") test.LoadUser(t, ctx, 2) ctx.Req.Form.Set("state", "open") Pulls(ctx) @@ -82,7 +82,7 @@ func TestMilestones(t *testing.T) { setting.UI.IssuePagingNum = 1 assert.NoError(t, unittest.LoadFixtures()) - ctx := test.MockContext(t, "milestones") + ctx, _ := test.MockContext(t, "milestones") test.LoadUser(t, ctx, 2) ctx.SetParams("sort", "issues") ctx.Req.Form.Set("state", "closed") @@ -101,7 +101,7 @@ func TestMilestonesForSpecificRepo(t *testing.T) { setting.UI.IssuePagingNum = 1 assert.NoError(t, unittest.LoadFixtures()) - ctx := test.MockContext(t, "milestones") + ctx, _ := test.MockContext(t, "milestones") test.LoadUser(t, ctx, 2) ctx.SetParams("sort", "issues") ctx.SetParams("repo", "1") |