From 610395d5a55ef0b82b7faaf70127c693d1abd58a Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Sun, 19 Jun 2022 17:10:24 +0200 Subject: [chore] make tests more cacheable by avoiding time.Now() (#656) --- internal/api/client/admin/mediacleanup_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/api/client/admin') diff --git a/internal/api/client/admin/mediacleanup_test.go b/internal/api/client/admin/mediacleanup_test.go index 449777541..50f23b2f0 100644 --- a/internal/api/client/admin/mediacleanup_test.go +++ b/internal/api/client/admin/mediacleanup_test.go @@ -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) -- cgit v1.2.3