mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-26 03:23:32 -06:00
[bugfix] Don't call strings.ToLower() on usernames when selecting account by domain+username (#1190)
* don't lowercase account username when doing a select * test getting remote user with uppercase username
This commit is contained in:
parent
8d581deb28
commit
3a11861ac6
9 changed files with 47 additions and 32 deletions
|
|
@ -70,7 +70,7 @@ func (suite *GetTestSuite) TestGet() {
|
|||
b, err := ioutil.ReadAll(result.Body)
|
||||
assert.NoError(suite.T(), err)
|
||||
|
||||
suite.Equal(`[{"id":"01FHMQX3GAABWSM0S2VZEC2SWC","username":"some_user","acct":"some_user@example.org","display_name":"some user","locked":true,"bot":false,"created_at":"2020-08-10T12:13:28.000Z","note":"i'm a real son of a gun","url":"http://example.org/@some_user","avatar":"","avatar_static":"","header":"http://localhost:8080/assets/default_header.png","header_static":"http://localhost:8080/assets/default_header.png","followers_count":0,"following_count":0,"statuses_count":0,"last_status_at":null,"emojis":[],"fields":[]}]`, string(b))
|
||||
suite.Equal(`[{"id":"01FHMQX3GAABWSM0S2VZEC2SWC","username":"Some_User","acct":"Some_User@example.org","display_name":"some user","locked":true,"bot":false,"created_at":"2020-08-10T12:13:28.000Z","note":"i'm a real son of a gun","url":"http://example.org/@Some_User","avatar":"","avatar_static":"","header":"http://localhost:8080/assets/default_header.png","header_static":"http://localhost:8080/assets/default_header.png","followers_count":0,"following_count":0,"statuses_count":0,"last_status_at":null,"emojis":[],"fields":[]}]`, string(b))
|
||||
}
|
||||
|
||||
func TestGetTestSuite(t *testing.T) {
|
||||
|
|
|
|||
|
|
@ -97,6 +97,23 @@ func (suite *SearchGetTestSuite) TestSearchRemoteAccountByNamestring() {
|
|||
suite.NotNil(gotAccount)
|
||||
}
|
||||
|
||||
func (suite *SearchGetTestSuite) TestSearchRemoteAccountByNamestringUppercase() {
|
||||
query := "@Some_User@example.org"
|
||||
resolve := true
|
||||
|
||||
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) TestSearchRemoteAccountByNamestringNoLeadingAt() {
|
||||
query := "brand_new_person@unknown-instance.com"
|
||||
resolve := true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue