diff options
author | Richard van der Hoff <1389908+richvdh@users.noreply.github.com> | 2019-09-25 11:32:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-25 11:32:05 +0100 |
commit | 8004d6ca2faf0f2f843fcdcaf225d7bcab847503 (patch) | |
tree | 79fa1179400a758fa973a515a6b397840ad289e6 /tests/test_terms_auth.py | |
parent | Merge pull request #6092 from matrix-org/babolivier/background_update_deactiv... (diff) | |
download | synapse-8004d6ca2faf0f2f843fcdcaf225d7bcab847503.tar.xz |
Refactor code for calculating registration flows (#6106)
because, frankly, it looked like it was written by an axe-murderer. This should be a non-functional change, except that where `m.login.dummy` was previously advertised *before* `m.login.terms`, it will now be advertised afterwards. AFAICT that should have no effect, and will be more consistent with the flows that involve passing a 3pid.
Diffstat (limited to '')
-rw-r--r-- | tests/test_terms_auth.py | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/tests/test_terms_auth.py b/tests/test_terms_auth.py index 52739fbabc..5ec5d2b358 100644 --- a/tests/test_terms_auth.py +++ b/tests/test_terms_auth.py @@ -28,6 +28,21 @@ from tests import unittest class TermsTestCase(unittest.HomeserverTestCase): servlets = [register_servlets] + def default_config(self, name="test"): + config = super().default_config(name) + config.update( + { + "public_baseurl": "https://example.org/", + "user_consent": { + "version": "1.0", + "policy_name": "My Cool Privacy Policy", + "template_dir": "/", + "require_at_registration": True, + }, + } + ) + return config + def prepare(self, reactor, clock, hs): self.clock = MemoryReactorClock() self.hs_clock = Clock(self.clock) @@ -35,17 +50,8 @@ class TermsTestCase(unittest.HomeserverTestCase): self.registration_handler = Mock() self.auth_handler = Mock() self.device_handler = Mock() - hs.config.enable_registration = True - hs.config.registrations_require_3pid = [] - hs.config.auto_join_rooms = [] - hs.config.enable_registration_captcha = False def test_ui_auth(self): - self.hs.config.user_consent_at_registration = True - self.hs.config.user_consent_policy_name = "My Cool Privacy Policy" - self.hs.config.public_baseurl = "https://example.org/" - self.hs.config.user_consent_version = "1.0" - # Do a UI auth request request, channel = self.make_request(b"POST", self.url, b"{}") self.render(request) |