summary refs log tree commit diff
path: root/tests/storage/test_profile.py
diff options
context:
space:
mode:
authorDirk Klimpel <5740567+dklimpel@users.noreply.github.com>2021-01-12 22:30:15 +0100
committerGitHub <noreply@github.com>2021-01-12 16:30:15 -0500
commit7a2e9b549defe3f55531711a863183a33e7af83c (patch)
tree1ceeb3a73fd7a8cfa16fca79632bbb0ce554b0bc /tests/storage/test_profile.py
parentUI Auth via SSO: redirect the user to an appropriate SSO. (#9081) (diff)
downloadsynapse-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/storage/test_profile.py')
-rw-r--r--tests/storage/test_profile.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/storage/test_profile.py b/tests/storage/test_profile.py
index 3fd0a38cf5..ea63bd56b4 100644
--- a/tests/storage/test_profile.py
+++ b/tests/storage/test_profile.py
@@ -48,6 +48,19 @@ class ProfileStoreTestCase(unittest.TestCase):
             ),
         )
 
+        # test set to None
+        yield defer.ensureDeferred(
+            self.store.set_profile_displayname(self.u_frank.localpart, None)
+        )
+
+        self.assertIsNone(
+            (
+                yield defer.ensureDeferred(
+                    self.store.get_profile_displayname(self.u_frank.localpart)
+                )
+            )
+        )
+
     @defer.inlineCallbacks
     def test_avatar_url(self):
         yield defer.ensureDeferred(self.store.create_profile(self.u_frank.localpart))
@@ -66,3 +79,16 @@ class ProfileStoreTestCase(unittest.TestCase):
                 )
             ),
         )
+
+        # test set to None
+        yield defer.ensureDeferred(
+            self.store.set_profile_avatar_url(self.u_frank.localpart, None)
+        )
+
+        self.assertIsNone(
+            (
+                yield defer.ensureDeferred(
+                    self.store.get_profile_avatar_url(self.u_frank.localpart)
+                )
+            )
+        )