From 4cf76a2bfcc2c19bdd34f1bd58d8545d3499481b Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Wed, 21 Sep 2022 19:55:52 +0200 Subject: [chore] Tidy up status deletion, remove from cache too (#845) * add func for deleting status from db + cache * move deletes entirely back to processor and also only do a delete if the requesting account owns the item being deleted * tidy up unboost processing * delete status more efficiently * fix wrong account id on remote test attachments * fix federator test --- internal/db/bundb/status_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'internal/db/bundb/status_test.go') diff --git a/internal/db/bundb/status_test.go b/internal/db/bundb/status_test.go index 36e329806..a796ebdad 100644 --- a/internal/db/bundb/status_test.go +++ b/internal/db/bundb/status_test.go @@ -25,6 +25,7 @@ import ( "time" "github.com/stretchr/testify/suite" + "github.com/superseriousbusiness/gotosocial/internal/db" ) type StatusTestSuite struct { @@ -132,6 +133,15 @@ func (suite *StatusTestSuite) TestGetStatusChildren() { } } +func (suite *StatusTestSuite) TestDeleteStatus() { + targetStatus := suite.testStatuses["admin_account_status_1"] + err := suite.db.DeleteStatusByID(context.Background(), targetStatus.ID) + suite.NoError(err) + + _, err = suite.db.GetStatusByID(context.Background(), targetStatus.ID) + suite.ErrorIs(err, db.ErrNoEntries) +} + func TestStatusTestSuite(t *testing.T) { suite.Run(t, new(StatusTestSuite)) } -- cgit v1.2.3