summary refs log tree commit diff
path: root/tests/handlers
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-03-25 13:28:42 +0000
committerGitHub <noreply@github.com>2022-03-25 13:28:42 +0000
commitfffb3c4c8f67c271a723855835c2ea0fb83fc33f (patch)
treef2f84efc57ec1d13e08939a45473ba8188385f14 /tests/handlers
parentAuthentik OpenID minor doc update (#12275) (diff)
downloadsynapse-fffb3c4c8f67c271a723855835c2ea0fb83fc33f.tar.xz
Always allow the empty string as an avatar_url. (#12261)
Hopefully this fixes #12257.

Co-authored-by: Patrick Cloke <clokep@users.noreply.github.com>
Diffstat (limited to 'tests/handlers')
-rw-r--r--tests/handlers/test_profile.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/handlers/test_profile.py b/tests/handlers/test_profile.py
index 08733a9f2d..1ec105c373 100644
--- a/tests/handlers/test_profile.py
+++ b/tests/handlers/test_profile.py
@@ -268,6 +268,12 @@ class ProfileTestCase(unittest.HomeserverTestCase):
         self.assertTrue(res)
 
     @unittest.override_config({"max_avatar_size": 50})
+    def test_avatar_constraints_allow_empty_avatar_url(self) -> None:
+        """An empty avatar is always permitted."""
+        res = self.get_success(self.handler.check_avatar_size_and_mime_type(""))
+        self.assertTrue(res)
+
+    @unittest.override_config({"max_avatar_size": 50})
     def test_avatar_constraints_missing(self) -> None:
         """Tests that an avatar isn't allowed if the file at the given MXC URI couldn't
         be found.