mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore] make tests more cacheable by avoiding time.Now() (#656)
This commit is contained in:
@ -81,7 +81,7 @@ func (suite *MediaCleanupTestSuite) TestMediaCleanupNoArg() {
|
||||
suite.NoError(err)
|
||||
|
||||
// the media should no longer be cached
|
||||
suite.True(prunedAttachment.Cached)
|
||||
suite.False(prunedAttachment.Cached)
|
||||
}
|
||||
|
||||
func (suite *MediaCleanupTestSuite) TestMediaCleanupNotOldEnough() {
|
||||
@ -90,7 +90,7 @@ func (suite *MediaCleanupTestSuite) TestMediaCleanupNotOldEnough() {
|
||||
|
||||
// set up the request
|
||||
recorder := httptest.NewRecorder()
|
||||
ctx := suite.newContext(recorder, http.MethodPost, []byte("{\"remote_cache_days\": 3}"), admin.EmojiPath, "application/json")
|
||||
ctx := suite.newContext(recorder, http.MethodPost, []byte("{\"remote_cache_days\": 10000}"), admin.EmojiPath, "application/json")
|
||||
|
||||
// call the handler
|
||||
suite.adminModule.MediaCleanupPOSTHandler(ctx)
|
||||
|
Reference in New Issue
Block a user