From c5d61bc8001b16e3dcedda9fd1229c27cca4bd3b Mon Sep 17 00:00:00 2001 From: Folker Bernitt Date: Mon, 18 Jan 2016 15:39:59 +0100 Subject: Refactory KeyResource to get services from session - Issue #576 - Only first step (other services not changed yet) - Faked session access for now --- service/test/support/integration/app_test_client.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'service/test/support/integration') 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): -- cgit v1.2.3