summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorRichard van der Hoff <1389908+richvdh@users.noreply.github.com>2020-10-05 21:40:51 +0100
committerGitHub <noreply@github.com>2020-10-05 21:40:51 +0100
commit785437dc0ddfb23012748895e1f8665338e4f3df (patch)
treefc018fd99457ee5535077c8225ac01d1018d0f13 /tests
parentEnsure that event.redacts is the proper type before handling it (#8457) (diff)
downloadsynapse-785437dc0ddfb23012748895e1f8665338e4f3df.tar.xz
Update default room version to 6 (#8461)
Per https://github.com/matrix-org/matrix-doc/pull/2788
Diffstat (limited to 'tests')
-rw-r--r--tests/rest/client/v1/test_directory.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/rest/client/v1/test_directory.py b/tests/rest/client/v1/test_directory.py
index 633b7dbda0..ea5a7f3739 100644
--- a/tests/rest/client/v1/test_directory.py
+++ b/tests/rest/client/v1/test_directory.py
@@ -21,6 +21,7 @@ from synapse.types import RoomAlias
 from synapse.util.stringutils import random_string
 
 from tests import unittest
+from tests.unittest import override_config
 
 
 class DirectoryTestCase(unittest.HomeserverTestCase):
@@ -67,10 +68,18 @@ class DirectoryTestCase(unittest.HomeserverTestCase):
         self.ensure_user_joined_room()
         self.set_alias_via_directory(400, alias_length=256)
 
-    def test_state_event_in_room(self):
+    @override_config({"default_room_version": 5})
+    def test_state_event_user_in_v5_room(self):
+        """Test that a regular user can add alias events before room v6"""
         self.ensure_user_joined_room()
         self.set_alias_via_state_event(200)
 
+    @override_config({"default_room_version": 6})
+    def test_state_event_v6_room(self):
+        """Test that a regular user can *not* add alias events from room v6"""
+        self.ensure_user_joined_room()
+        self.set_alias_via_state_event(403)
+
     def test_directory_in_room(self):
         self.ensure_user_joined_room()
         self.set_alias_via_directory(200)