summaryrefslogtreecommitdiff
path: root/service/test/unit/resources
diff options
context:
space:
mode:
authorNavaL <mnandri@thoughtworks.com>2016-01-19 10:41:35 +0100
committerNavaL <mnandri@thoughtworks.com>2016-01-19 10:41:35 +0100
commit88b94a888adf45f537a759dca4401d90f7923ae1 (patch)
tree29a07128ef1f190f89b015a616a06e95e2dbae9b /service/test/unit/resources
parent2771d5e8930041b8bcef3ff78e2456bef45554e1 (diff)
fixing build
Issue #576
Diffstat (limited to 'service/test/unit/resources')
-rw-r--r--service/test/unit/resources/test_root_resource.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/service/test/unit/resources/test_root_resource.py b/service/test/unit/resources/test_root_resource.py
index c4ffc068..4a8e1d7e 100644
--- a/service/test/unit/resources/test_root_resource.py
+++ b/service/test/unit/resources/test_root_resource.py
@@ -10,17 +10,20 @@ class TestRootResource(unittest.TestCase):
MAIL_ADDRESS = 'test_user@pixelated-project.org'
def setUp(self):
- self.services_factory_mock = mock()
- self.mail_service_mock = mock()
- root_resource = RootResource(self.services_factory_mock)
- root_resource._mode = root_resource
- root_resource.account_email = self.MAIL_ADDRESS
+ self.mail_service = mock()
+ self.services_factory = mock()
+ self.services = mock()
+ self.services.mail_service = self.mail_service
+ self.services_factory._services_by_user = {'someuserid': self.mail_service}
+ when(self.services_factory).services(ANY()).thenReturn(self.services)
+ self.mail_service.account_email = self.MAIL_ADDRESS
+
+ root_resource = RootResource(self.services_factory)
root_resource._html_template = "<html><head><title>$account_email</title></head></html>"
+ root_resource._mode = root_resource
self.web = DummySite(root_resource)
def test_render_GET_should_template_account_email(self):
- when(self.services_factory_mock).mail_service(ANY()).thenReturn(self.mail_service_mock)
- self.mail_service_mock.account_email = self.MAIL_ADDRESS
request = DummyRequest([''])
d = self.web.get(request)