|
|
|
@ -71,6 +71,7 @@ class RegisterTestCase(unittest.HomeserverTestCase): |
|
|
|
|
self.keycloak_client = hs.get_keycloak_client() |
|
|
|
|
self.nextcloud_client = hs.get_nextcloud_client() |
|
|
|
|
self.keycloak_client.add_user = simple_async_mock() |
|
|
|
|
self.keycloak_client.update_user = simple_async_mock() |
|
|
|
|
self.keycloak_client.get_user = simple_async_mock(return_value={"id": "user1"}) |
|
|
|
|
self.nextcloud_client.add_user = simple_async_mock() |
|
|
|
|
|
|
|
|
@ -88,6 +89,7 @@ class RegisterTestCase(unittest.HomeserverTestCase): |
|
|
|
|
self.render(request) |
|
|
|
|
|
|
|
|
|
self.assertTrue(self.keycloak_client.add_user.called) |
|
|
|
|
self.assertTrue(self.keycloak_client.update_user.called) |
|
|
|
|
self.assertTrue(self.keycloak_client.get_user.called) |
|
|
|
|
self.assertTrue(self.nextcloud_client.add_user.called) |
|
|
|
|
self.assertEqual(channel.code, 200) |
|
|
|
@ -106,6 +108,7 @@ class RegisterTestCase(unittest.HomeserverTestCase): |
|
|
|
|
self.render(request) |
|
|
|
|
|
|
|
|
|
self.assertTrue(self.keycloak_client.add_user.called) |
|
|
|
|
self.assertTrue(self.keycloak_client.update_user.called) |
|
|
|
|
self.assertTrue(self.keycloak_client.get_user.called) |
|
|
|
|
self.assertTrue(self.nextcloud_client.add_user.called) |
|
|
|
|
self.assertEqual(channel.code, 200) |
|
|
|
@ -124,6 +127,7 @@ class RegisterTestCase(unittest.HomeserverTestCase): |
|
|
|
|
self.render(request) |
|
|
|
|
|
|
|
|
|
self.keycloak_client.add_user.not_called() |
|
|
|
|
self.keycloak_client.update_user.not_called() |
|
|
|
|
self.keycloak_client.get_user.not_called() |
|
|
|
|
self.nextcloud_client.add_user.not_called() |
|
|
|
|
|
|
|
|
@ -147,6 +151,7 @@ class RegisterTestCase(unittest.HomeserverTestCase): |
|
|
|
|
self.render(request) |
|
|
|
|
|
|
|
|
|
self.keycloak_client.add_user.not_called() |
|
|
|
|
self.keycloak_client.update_user.not_called() |
|
|
|
|
self.keycloak_client.get_user.not_called() |
|
|
|
|
self.nextcloud_client.add_user.not_called() |
|
|
|
|
|
|
|
|
|