summary refs log tree commit diff
path: root/tests/server_notices/test_consent.py
diff options
context:
space:
mode:
authorAmber Brown <hawkowl@atleastfornow.net>2019-05-13 15:01:58 -0500
committerAmber Brown <hawkowl@atleastfornow.net>2019-05-13 15:01:58 -0500
commita1b8767da85794eb24e3b9fbce1aed87a04ea328 (patch)
treefd32dadee1bcd78d34de73c5398390c26a7cd974 /tests/server_notices/test_consent.py
parentMerge remote-tracking branch 'origin/develop' into shhs (diff)
parentMigrate all tests to use the dict-based config format instead of hanging item... (diff)
downloadsynapse-a1b8767da85794eb24e3b9fbce1aed87a04ea328.tar.xz
Merge remote-tracking branch 'origin/develop' into shhs
Diffstat (limited to 'tests/server_notices/test_consent.py')
-rw-r--r--tests/server_notices/test_consent.py32
1 files changed, 21 insertions, 11 deletions
diff --git a/tests/server_notices/test_consent.py b/tests/server_notices/test_consent.py

index e0b4e0eb63..872039c8f1 100644 --- a/tests/server_notices/test_consent.py +++ b/tests/server_notices/test_consent.py
@@ -12,6 +12,9 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +import os + import synapse.rest.admin from synapse.rest.client.v1 import login, room from synapse.rest.client.v2_alpha import sync @@ -30,20 +33,27 @@ class ConsentNoticesTests(unittest.HomeserverTestCase): def make_homeserver(self, reactor, clock): + tmpdir = self.mktemp() + os.mkdir(tmpdir) self.consent_notice_message = "consent %(consent_uri)s" config = self.default_config() - config.user_consent_version = "1" - config.user_consent_server_notice_content = { - "msgtype": "m.text", - "body": self.consent_notice_message, + config["user_consent"] = { + "version": "1", + "template_dir": tmpdir, + "server_notice_content": { + "msgtype": "m.text", + "body": self.consent_notice_message, + }, + } + config["public_baseurl"] = "https://example.com/" + config["form_secret"] = "123abc" + + config["server_notices"] = { + "system_mxid_localpart": "notices", + "system_mxid_display_name": "test display name", + "system_mxid_avatar_url": None, + "room_name": "Server Notices", } - config.public_baseurl = "https://example.com/" - config.form_secret = "123abc" - - config.server_notices_mxid = "@notices:test" - config.server_notices_mxid_display_name = "test display name" - config.server_notices_mxid_avatar_url = None - config.server_notices_room_name = "Server Notices" hs = self.setup_test_homeserver(config=config)