mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2025-05-20 14:50:32 -04:00
Fix destination_is
errors seen in sentry. (#13041)
* Rename test_fedclient to match its source file * Require at least one destination to be truthy * Explicitly validate user ID in profile endpoint GETs Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
This commit is contained in:
parent
aef398457f
commit
c99b511db9
7 changed files with 59 additions and 8 deletions
|
@ -13,6 +13,8 @@
|
|||
# limitations under the License.
|
||||
|
||||
"""Tests REST events for /profile paths."""
|
||||
import urllib.parse
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from twisted.test.proto_helpers import MemoryReactor
|
||||
|
@ -49,6 +51,12 @@ class ProfileTestCase(unittest.HomeserverTestCase):
|
|||
res = self._get_displayname()
|
||||
self.assertEqual(res, "owner")
|
||||
|
||||
def test_get_displayname_rejects_bad_username(self) -> None:
|
||||
channel = self.make_request(
|
||||
"GET", f"/profile/{urllib.parse.quote('@alice:')}/displayname"
|
||||
)
|
||||
self.assertEqual(channel.code, HTTPStatus.BAD_REQUEST, channel.result)
|
||||
|
||||
def test_set_displayname(self) -> None:
|
||||
channel = self.make_request(
|
||||
"PUT",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue