summaryrefslogtreecommitdiff
path: root/service/test/support
diff options
context:
space:
mode:
authorFolker Bernitt <fbernitt@thoughtworks.com>2016-01-18 15:39:59 +0100
committerFolker Bernitt <fbernitt@thoughtworks.com>2016-01-18 15:39:59 +0100
commitc5d61bc8001b16e3dcedda9fd1229c27cca4bd3b (patch)
treea36fb87a31b7692d124b959ba32ba49f48a14ed8 /service/test/support
parent0b06feff629f91d2fa4e7bdbe3b8e46b412e6158 (diff)
Refactory KeyResource to get services from session
- Issue #576 - Only first step (other services not changed yet) - Faked session access for now
Diffstat (limited to 'service/test/support')
-rw-r--r--service/test/support/integration/app_test_client.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/service/test/support/integration/app_test_client.py b/service/test/support/integration/app_test_client.py
index 40c24418..16344171 100644
--- a/service/test/support/integration/app_test_client.py
+++ b/service/test/support/integration/app_test_client.py
@@ -33,6 +33,7 @@ from twisted.web.resource import getChildForRequest
# from twisted.web.server import Site as PixelatedSite
from pixelated.adapter.mailstore.leap_attachment_store import LeapAttachmentStore
from pixelated.adapter.services.feedback_service import FeedbackService
+from pixelated.application import ServicesFactory
from pixelated.config.site import PixelatedSite
from pixelated.adapter.mailstore import LeapMailStore
@@ -85,8 +86,14 @@ class AppTestClient(object):
self.search_engine.index_mails(mails)
self.resource = RootResource()
+
+ self.service_factory = ServicesFactory()
+ services = mock()
+ services.keymanager = self.keymanager
+ self.service_factory.add_session('someuserid', services)
+
self.resource.initialize(
- self.keymanager, self.search_engine, self.mail_service, self.draft_service, self.feedback_service)
+ self.service_factory, self.keymanager, self.search_engine, self.mail_service, self.draft_service, self.feedback_service)
def _render(self, request, as_json=True):
def get_str(_str):