mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 23:12:26 -05:00
[chore] make tests more cacheable by avoiding time.Now() (#656)
This commit is contained in:
parent
f42d5d807c
commit
610395d5a5
3 changed files with 123 additions and 129 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue