diff options
Diffstat (limited to 'api/post_test.go')
-rw-r--r-- | api/post_test.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/api/post_test.go b/api/post_test.go index d382786cc..c97da6f68 100644 --- a/api/post_test.go +++ b/api/post_test.go @@ -136,7 +136,7 @@ func TestCreatePost(t *testing.T) { } else if rpost9 := resp.Data.(*model.Post); len(rpost9.FileIds) != 3 { t.Fatal("post should have 3 files") } else { - infos := store.Must(app.Srv.Store.FileInfo().GetForPost(rpost9.Id)).([]*model.FileInfo) + infos := store.Must(app.Srv.Store.FileInfo().GetForPost(rpost9.Id, true)).([]*model.FileInfo) if len(infos) != 3 { t.Fatal("should've attached all 3 files to post") @@ -1184,6 +1184,7 @@ func TestGetMessageForNotification(t *testing.T) { post.FileIds = model.StringArray{testPng.Id, testJpg1.Id} store.Must(app.Srv.Store.FileInfo().AttachToPost(testJpg1.Id, post.Id)) + app.Srv.Store.FileInfo().InvalidateFileInfosForPostCache(post.Id) if message := app.GetMessageForNotification(post, translateFunc); message != "2 images sent: test1.png, test2.jpg" && message != "2 images sent: test2.jpg, test1.png" { t.Fatal("should've returned number of images:", message) } @@ -1196,6 +1197,7 @@ func TestGetMessageForNotification(t *testing.T) { } store.Must(app.Srv.Store.FileInfo().AttachToPost(testJpg2.Id, post.Id)) + app.Srv.Store.FileInfo().InvalidateFileInfosForPostCache(post.Id) post.FileIds = model.StringArray{testFile.Id, testJpg2.Id} if message := app.GetMessageForNotification(post, translateFunc); message != "2 files sent: test1.go, test3.jpg" && message != "2 files sent: test3.jpg, test1.go" { t.Fatal("should've returned number of mixed files:", message) |