summaryrefslogtreecommitdiff
path: root/internal/api/client
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/client')
-rw-r--r--internal/api/client/accounts/accountupdate_test.go2
-rw-r--r--internal/api/client/accounts/accountverify_test.go2
-rw-r--r--internal/api/client/statuses/statuscreate_test.go22
3 files changed, 16 insertions, 10 deletions
diff --git a/internal/api/client/accounts/accountupdate_test.go b/internal/api/client/accounts/accountupdate_test.go
index 73e33390f..50443ceb6 100644
--- a/internal/api/client/accounts/accountupdate_test.go
+++ b/internal/api/client/accounts/accountupdate_test.go
@@ -481,7 +481,7 @@ func (suite *AccountUpdateTestSuite) TestUpdateAccountSourceBadContentTypeFormDa
if err != nil {
suite.FailNow(err.Error())
}
- suite.Equal(data["source[status_content_type]"][0], dbAccount.StatusContentType)
+ suite.Equal(data["source[status_content_type]"][0], dbAccount.Settings.StatusContentType)
}
func (suite *AccountUpdateTestSuite) TestAccountUpdateCredentialsPATCHHandlerUpdateStatusContentTypeBad() {
diff --git a/internal/api/client/accounts/accountverify_test.go b/internal/api/client/accounts/accountverify_test.go
index 744488bf3..eccda8b2e 100644
--- a/internal/api/client/accounts/accountverify_test.go
+++ b/internal/api/client/accounts/accountverify_test.go
@@ -81,7 +81,7 @@ func (suite *AccountVerifyTestSuite) TestAccountVerifyGet() {
suite.Equal(2, apimodelAccount.FollowingCount)
suite.Equal(7, apimodelAccount.StatusesCount)
suite.EqualValues(gtsmodel.VisibilityPublic, apimodelAccount.Source.Privacy)
- suite.Equal(testAccount.Language, apimodelAccount.Source.Language)
+ suite.Equal(testAccount.Settings.Language, apimodelAccount.Source.Language)
suite.Equal(testAccount.NoteRaw, apimodelAccount.Source.Note)
}
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 := &gtsmodel.Account{}
+ *testAccount = *suite.testAccounts["local_account_1"]
+
+ // Copy zork's settings.
+ settings := &gtsmodel.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")