diff options
author | 2024-03-22 14:03:46 +0100 | |
---|---|---|
committer | 2024-03-22 14:03:46 +0100 | |
commit | 7f4a0a1aeb8a294ee967c63d7a48446df013ec44 (patch) | |
tree | b9b3836fa0abe1d7a5758d07d6ebb6486a353d56 /internal/api/client/statuses/statuscreate_test.go | |
parent | [bugfix] add all possible busy result codes to the sqlite errBusy catching ch... (diff) | |
download | gotosocial-7f4a0a1aeb8a294ee967c63d7a48446df013ec44.tar.xz |
[chore] Move local account settings to separate db table (#2770)
* [chore] Move local account settings to separate database model
* don't use separate settings_id
Diffstat (limited to 'internal/api/client/statuses/statuscreate_test.go')
-rw-r--r-- | internal/api/client/statuses/statuscreate_test.go | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/internal/api/client/statuses/statuscreate_test.go b/internal/api/client/statuses/statuscreate_test.go index ab7c67abf..b49e72ead 100644 --- a/internal/api/client/statuses/statuscreate_test.go +++ b/internal/api/client/statuses/statuscreate_test.go @@ -103,16 +103,22 @@ func (suite *StatusCreateTestSuite) TestPostNewStatus() { } func (suite *StatusCreateTestSuite) TestPostNewStatusMarkdown() { - // set default post language of account 1 to markdown - testAccount := suite.testAccounts["local_account_1"] - testAccount.StatusContentType = "text/markdown" - a := testAccount - - err := suite.db.UpdateAccount(context.Background(), a) + // Copy zork. + testAccount := >smodel.Account{} + *testAccount = *suite.testAccounts["local_account_1"] + + // Copy zork's settings. + settings := >smodel.AccountSettings{} + *settings = *suite.testAccounts["local_account_1"].Settings + testAccount.Settings = settings + + // set default post language of zork to markdown + testAccount.Settings.StatusContentType = "text/markdown" + err := suite.db.UpdateAccountSettings(context.Background(), testAccount.Settings) if err != nil { suite.FailNow(err.Error()) } - suite.Equal(a.StatusContentType, "text/markdown") + suite.Equal(testAccount.Settings.StatusContentType, "text/markdown") t := suite.testTokens["local_account_1"] oauthToken := oauth.DBTokenToToken(t) @@ -122,7 +128,7 @@ func (suite *StatusCreateTestSuite) TestPostNewStatusMarkdown() { ctx.Set(oauth.SessionAuthorizedApplication, suite.testApplications["application_1"]) ctx.Set(oauth.SessionAuthorizedToken, oauthToken) ctx.Set(oauth.SessionAuthorizedUser, suite.testUsers["local_account_1"]) - ctx.Set(oauth.SessionAuthorizedAccount, a) + ctx.Set(oauth.SessionAuthorizedAccount, testAccount) ctx.Request = httptest.NewRequest(http.MethodPost, fmt.Sprintf("http://localhost:8080/%s", statuses.BasePath), nil) ctx.Request.Header.Set("accept", "application/json") |