summaryrefslogtreecommitdiff
path: root/internal/db/bundb/account_test.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2022-09-26 14:43:19 +0200
committerLibravatar GitHub <noreply@github.com>2022-09-26 14:43:19 +0200
commit429bb770e22cda6e6decdaa68e4b42bee7b6b192 (patch)
tree17aebbe34bf20cd7d1346d104afa61d14ee1021e /internal/db/bundb/account_test.go
parent[feature] Show + federate emojis in accounts (#837) (diff)
downloadgotosocial-429bb770e22cda6e6decdaa68e4b42bee7b6b192.tar.xz
[performance] Update indexes that were causing slow db queries (#855)v0.5.0-rc3
* add status.url index, use id desc in some indexes * test account last posted
Diffstat (limited to 'internal/db/bundb/account_test.go')
-rw-r--r--internal/db/bundb/account_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/internal/db/bundb/account_test.go b/internal/db/bundb/account_test.go
index 1e6dc4436..ad2a217af 100644
--- a/internal/db/bundb/account_test.go
+++ b/internal/db/bundb/account_test.go
@@ -139,6 +139,12 @@ func (suite *AccountTestSuite) TestUpdateAccount() {
suite.WithinDuration(time.Now(), noCache.UpdatedAt, 5*time.Second)
}
+func (suite *AccountTestSuite) TestGetAccountLastPosted() {
+ lastPosted, err := suite.db.GetAccountLastPosted(context.Background(), suite.testAccounts["local_account_1"].ID)
+ suite.NoError(err)
+ suite.EqualValues(1653046675, lastPosted.Unix())
+}
+
func (suite *AccountTestSuite) TestInsertAccountWithDefaults() {
key, err := rsa.GenerateKey(rand.Reader, 2048)
suite.NoError(err)