summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorMathieu Velten <mathieuv@matrix.org>2023-07-27 15:45:05 +0200
committerGitHub <noreply@github.com>2023-07-27 15:45:05 +0200
commita719b703d9bd0dade2565ddcad0e2f3a7a9d4c37 (patch)
tree3015ecadb093ac002aa6b4a73b4e6a994e188c42 /tests
parentUpdate PyYAML to 6.0.1 (#16011) (diff)
downloadsynapse-a719b703d9bd0dade2565ddcad0e2f3a7a9d4c37.tar.xz
Fix 404 on /profile when the display name is empty but not the avatar (#16012)
Diffstat (limited to 'tests')
-rw-r--r--tests/handlers/test_profile.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/handlers/test_profile.py b/tests/handlers/test_profile.py
index 196ceb0b82..ec2f5d30be 100644
--- a/tests/handlers/test_profile.py
+++ b/tests/handlers/test_profile.py
@@ -179,6 +179,16 @@ class ProfileTestCase(unittest.HomeserverTestCase):
 
         self.assertEqual("http://my.server/me.png", avatar_url)
 
+    def test_get_profile_empty_displayname(self) -> None:
+        self.get_success(self.store.set_profile_displayname(self.frank, None))
+        self.get_success(
+            self.store.set_profile_avatar_url(self.frank, "http://my.server/me.png")
+        )
+
+        profile = self.get_success(self.handler.get_profile(self.frank.to_string()))
+
+        self.assertEqual("http://my.server/me.png", profile["avatar_url"])
+
     def test_set_my_avatar(self) -> None:
         self.get_success(
             self.handler.set_avatar_url(