summary refs log tree commit diff
path: root/tests/storage/test_user_directory.py
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2021-10-13 12:46:30 +0100
committerDavid Robertson <davidr@element.io>2021-10-13 12:46:30 +0100
commitb3e9b00fb28edc5d51d9a2d9b0652f9adc4b57cc (patch)
treeacab697f7dbcf26d7a7d6516b4f0db74feede586 /tests/storage/test_user_directory.py
parentAdd type hints to synapse.events.*. (#11066) (diff)
parentStop user directory from failing if it encounters users not in the `users` ta... (diff)
downloadsynapse-b3e9b00fb28edc5d51d9a2d9b0652f9adc4b57cc.tar.xz
Merge remote-tracking branch 'origin/release-v1.45' into develop
Diffstat (limited to 'tests/storage/test_user_directory.py')
-rw-r--r--tests/storage/test_user_directory.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/storage/test_user_directory.py b/tests/storage/test_user_directory.py

index 9f483ad681..be3ed64f5e 100644 --- a/tests/storage/test_user_directory.py +++ b/tests/storage/test_user_directory.py
@@ -256,7 +256,7 @@ class UserDirectoryInitialPopulationTestcase(HomeserverTestCase): users = self.get_success(self.user_dir_helper.get_users_in_user_directory()) self.assertEqual(users, {u1, u2, u3}) - # The next three tests (test_population_excludes_*) all set up + # The next four tests (test_population_excludes_*) all set up # - A normal user included in the user dir # - A public and private room created by that user # - A user excluded from the room dir, belonging to both rooms @@ -364,6 +364,21 @@ class UserDirectoryInitialPopulationTestcase(HomeserverTestCase): # Check the AS user is not in the directory. self._check_room_sharing_tables(user, public, private) + def test_population_excludes_appservice_sender(self) -> None: + user = self.register_user("user", "pass") + token = self.login(user, "pass") + + # Join the AS sender to rooms owned by the normal user. + public, private = self._create_rooms_and_inject_memberships( + user, token, self.appservice.sender + ) + + # Rebuild the directory. + self._purge_and_rebuild_user_dir() + + # Check the AS sender is not in the directory. + self._check_room_sharing_tables(user, public, private) + def test_population_conceals_private_nickname(self) -> None: # Make a private room, and set a nickname within user = self.register_user("aaaa", "pass")