def test_segments(self): """ L{LoginPage.beforeRender} should fill the I{login-action} slot with an L{URL} which includes all the segments given to the L{LoginPage}. """ segments = ('foo', 'bar') page = LoginPage(self.siteStore, segments) page.beforeRender(self.context) loginAction = self.context.locateSlotData('login-action') expectedLocation = URL.fromString('/') for segment in (LOGIN_AVATAR, ) + segments: expectedLocation = expectedLocation.child(segment) self.assertEqual(loginAction, expectedLocation)
def test_segments(self): """ L{LoginPage.beforeRender} should fill the I{login-action} slot with an L{URL} which includes all the segments given to the L{LoginPage}. """ segments = ('foo', 'bar') page = LoginPage(self.siteStore, segments) page.beforeRender(self.context) loginAction = self.context.locateSlotData('login-action') expectedLocation = URL.fromString('/') for segment in (LOGIN_AVATAR,) + segments: expectedLocation = expectedLocation.child(segment) self.assertEqual(loginAction, expectedLocation)
def test_queryArguments(self): """ L{LoginPage.beforeRender} should fill the I{login-action} slot with an L{URL} which includes all the query arguments given to the L{LoginPage}. """ args = {'foo': ['bar']} page = LoginPage(self.siteStore, (), args) page.beforeRender(self.context) loginAction = self.context.locateSlotData('login-action') expectedLocation = URL.fromString('/') expectedLocation = expectedLocation.child(LOGIN_AVATAR) expectedLocation = expectedLocation.add('foo', 'bar') self.assertEqual(loginAction, expectedLocation)