summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-10-21 16:00:41 +0800
committerGitHub <noreply@github.com>2021-10-21 09:00:41 +0100
commita87b81395581adef87bd99529abb5573311bef63 (patch)
treee787a205cf4b3ab2f9a365b45cc9fa35e7eebfc7
parent3baeec745cfb2dd9488df98d5d550e5024298749 (diff)
downloadgitea-a87b81395581adef87bd99529abb5573311bef63.tar.gz
gitea-a87b81395581adef87bd99529abb5573311bef63.zip
Fix heatmap test (#17381) (#17383)
Backport #17381
-rw-r--r--integrations/api_user_heatmap_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/integrations/api_user_heatmap_test.go b/integrations/api_user_heatmap_test.go
index a0f0552a17..019cf7dcac 100644
--- a/integrations/api_user_heatmap_test.go
+++ b/integrations/api_user_heatmap_test.go
@@ -8,8 +8,10 @@ import (
"fmt"
"net/http"
"testing"
+ "time"
"code.gitea.io/gitea/models"
+ "code.gitea.io/gitea/modules/timeutil"
"github.com/stretchr/testify/assert"
)
@@ -20,6 +22,10 @@ func TestUserHeatmap(t *testing.T) {
normalUsername := "user2"
session := loginUser(t, adminUsername)
+ var fakeNow = time.Date(2011, 10, 20, 0, 0, 0, 0, time.Local)
+ timeutil.Set(fakeNow)
+ defer timeutil.Unset()
+
urlStr := fmt.Sprintf("/api/v1/users/%s/heatmap", normalUsername)
req := NewRequest(t, "GET", urlStr)
resp := session.MakeRequest(t, req, http.StatusOK)