diff options
author | Dirk Klimpel <5740567+dklimpel@users.noreply.github.com> | 2021-01-12 22:30:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-12 16:30:15 -0500 |
commit | 7a2e9b549defe3f55531711a863183a33e7af83c (patch) | |
tree | 1ceeb3a73fd7a8cfa16fca79632bbb0ce554b0bc /tests/handlers/test_profile.py | |
parent | UI Auth via SSO: redirect the user to an appropriate SSO. (#9081) (diff) | |
download | synapse-7a2e9b549defe3f55531711a863183a33e7af83c.tar.xz |
Remove user's avatar URL and displayname when deactivated. (#8932)
This only applies if the user's data is to be erased.
Diffstat (limited to 'tests/handlers/test_profile.py')
-rw-r--r-- | tests/handlers/test_profile.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/handlers/test_profile.py b/tests/handlers/test_profile.py index 919547556b..022943a10a 100644 --- a/tests/handlers/test_profile.py +++ b/tests/handlers/test_profile.py @@ -105,6 +105,21 @@ class ProfileTestCase(unittest.TestCase): "Frank", ) + # Set displayname to an empty string + yield defer.ensureDeferred( + self.handler.set_displayname( + self.frank, synapse.types.create_requester(self.frank), "" + ) + ) + + self.assertIsNone( + ( + yield defer.ensureDeferred( + self.store.get_profile_displayname(self.frank.localpart) + ) + ) + ) + @defer.inlineCallbacks def test_set_my_name_if_disabled(self): self.hs.config.enable_set_displayname = False @@ -223,6 +238,21 @@ class ProfileTestCase(unittest.TestCase): "http://my.server/me.png", ) + # Set avatar to an empty string + yield defer.ensureDeferred( + self.handler.set_avatar_url( + self.frank, synapse.types.create_requester(self.frank), "", + ) + ) + + self.assertIsNone( + ( + yield defer.ensureDeferred( + self.store.get_profile_avatar_url(self.frank.localpart) + ) + ), + ) + @defer.inlineCallbacks def test_set_my_avatar_if_disabled(self): self.hs.config.enable_set_avatar_url = False |