[bugfix] Don't try to get user when serializing local instance account (#1757)

This commit is contained in:
tobi 2023-05-09 17:05:35 +02:00 committed by GitHub
commit 878ed48de3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 139 additions and 29 deletions

View file

@ -235,6 +235,23 @@ func (suite *SearchGetTestSuite) TestSearchLocalAccountByURI() {
suite.NotNil(gotAccount)
}
func (suite *SearchGetTestSuite) TestSearchLocalInstanceAccountByURI() {
query := "http://localhost:8080/users/localhost:8080"
resolve := false
searchResult, err := suite.testSearch(query, resolve, http.StatusOK)
if err != nil {
suite.FailNow(err.Error())
}
if !suite.Len(searchResult.Accounts, 1) {
suite.FailNow("expected 1 account in search results but got 0")
}
gotAccount := searchResult.Accounts[0]
suite.NotNil(gotAccount)
}
func (suite *SearchGetTestSuite) TestSearchLocalAccountByURL() {
query := "http://localhost:8080/@the_mighty_zork"
resolve := false