diff options
author | Roald de Vries <rdevries@thoughtworks.com> | 2016-11-29 17:47:07 +0100 |
---|---|---|
committer | Roald de Vries <rdevries@thoughtworks.com> | 2016-11-29 17:47:07 +0100 |
commit | 9b5d5a797c9f407183d1b9a6a2aea552a06c5ea1 (patch) | |
tree | 4d3ae165dd4ab2e10f2c8fe2c75bacb1ae31590f /service/test/unit | |
parent | 798858c79c0b10565f42365c6cdbf7d0549d0a2e (diff) |
make login resource part of the public root resource
Diffstat (limited to 'service/test/unit')
-rw-r--r-- | service/test/unit/resources/test_root_resource.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/service/test/unit/resources/test_root_resource.py b/service/test/unit/resources/test_root_resource.py index 8d658d7e..06eaf1ad 100644 --- a/service/test/unit/resources/test_root_resource.py +++ b/service/test/unit/resources/test_root_resource.py @@ -19,7 +19,17 @@ from pixelated.resources.root_resource import InboxResource, PublicRootResource, class TestPublicRootResource(unittest.TestCase): - pass + + def setUp(self): + self.public_root_resource = PublicRootResource(mock()) + self.web = DummySite(self.public_root_resource) + + def test_login_url_should_delegate_to_login_resource(self): + self.public_root_resource.initialize(provider=mock(), authenticator=mock()) + request = DummyRequest(['login']) + request.addCookie = lambda key, value: 'stubbed' + child_resource = getChildForRequest(self.public_root_resource, request) + self.assertIsInstance(child_resource, LoginResource) class TestRootResource(unittest.TestCase): @@ -35,9 +45,8 @@ class TestRootResource(unittest.TestCase): when(self.services_factory).services(ANY()).thenReturn(self.services) self.mail_service.account_email = self.MAIL_ADDRESS - root_resource = RootResource(self.services_factory) - self.web = DummySite(root_resource) - self.root_resource = root_resource + self.root_resource = RootResource(self.services_factory) + self.web = DummySite(self.root_resource) def test_root_url_should_delegate_to_inbox(self): request = DummyRequest(['']) |