mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	Fix heatmap test (#17381)
This commit is contained in:
		@@ -8,8 +8,10 @@ import (
 | 
				
			|||||||
	"fmt"
 | 
						"fmt"
 | 
				
			||||||
	"net/http"
 | 
						"net/http"
 | 
				
			||||||
	"testing"
 | 
						"testing"
 | 
				
			||||||
 | 
						"time"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"code.gitea.io/gitea/models"
 | 
						"code.gitea.io/gitea/models"
 | 
				
			||||||
 | 
						"code.gitea.io/gitea/modules/timeutil"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	"github.com/stretchr/testify/assert"
 | 
						"github.com/stretchr/testify/assert"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
@@ -20,6 +22,10 @@ func TestUserHeatmap(t *testing.T) {
 | 
				
			|||||||
	normalUsername := "user2"
 | 
						normalUsername := "user2"
 | 
				
			||||||
	session := loginUser(t, adminUsername)
 | 
						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)
 | 
						urlStr := fmt.Sprintf("/api/v1/users/%s/heatmap", normalUsername)
 | 
				
			||||||
	req := NewRequest(t, "GET", urlStr)
 | 
						req := NewRequest(t, "GET", urlStr)
 | 
				
			||||||
	resp := session.MakeRequest(t, req, http.StatusOK)
 | 
						resp := session.MakeRequest(t, req, http.StatusOK)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user