summaryrefslogtreecommitdiff
path: root/service/test/support/integration
diff options
context:
space:
mode:
authorNavaL <mnandri@thoughtworks.com>2016-01-26 10:12:23 +0100
committerNavaL <mnandri@thoughtworks.com>2016-01-26 10:12:23 +0100
commitbb823fda470a0c5e75e8d39da1cb269eaa8fc568 (patch)
treea51a90d525625212dc72216bb50945b553f7de5b /service/test/support/integration
parentd95509bf6641ce0722e9f75608360d5b68086678 (diff)
minor refactorings
Issue #576
Diffstat (limited to 'service/test/support/integration')
-rw-r--r--service/test/support/integration/multi_user_client.py16
1 files changed, 2 insertions, 14 deletions
diff --git a/service/test/support/integration/multi_user_client.py b/service/test/support/integration/multi_user_client.py
index c610c3e8..897799aa 100644
--- a/service/test/support/integration/multi_user_client.py
+++ b/service/test/support/integration/multi_user_client.py
@@ -27,7 +27,7 @@ from leap.auth import SRPAuth
from pixelated.adapter.mailstore.leap_attachment_store import LeapAttachmentStore
from pixelated.adapter.services.feedback_service import FeedbackService
-from pixelated.application import UserAgentMode, ServicesFactory
+from pixelated.application import UserAgentMode, ServicesFactory, set_up_protected_resources
from pixelated.adapter.mailstore import LeapMailStore
from pixelated.adapter.mailstore.searchable_mailstore import SearchableMailStore
@@ -58,20 +58,8 @@ class MultiUserClient(AppTestClient):
self.service_factory = ServicesFactory(UserAgentMode(is_single_user=False))
root_resource = RootResource(self.service_factory)
- anonymous_resource = LoginResource(self.service_factory)
-
leap_provider = mock()
- checker = LeapPasswordChecker(leap_provider)
- session_checker = SessionChecker()
-
- realm = PixelatedRealm(root_resource, anonymous_resource)
- _portal = portal.Portal(realm, [checker, session_checker, AllowAnonymousAccess()])
-
- protected_resource = PixelatedAuthSessionWrapper(_portal, root_resource, anonymous_resource, [])
- anonymous_resource.set_portal(_portal)
- root_resource.initialize(_portal)
-
- self.resource = protected_resource
+ self.resource = set_up_protected_resources(root_resource, leap_provider, self.service_factory)
@defer.inlineCallbacks
def login(self, username='username', password='password'):