equal
deleted
inserted
replaced
841 |
841 |
842 class LoginControllerTC(CubicWebTC): |
842 class LoginControllerTC(CubicWebTC): |
843 |
843 |
844 def test_login_with_dest(self): |
844 def test_login_with_dest(self): |
845 req = self.request() |
845 req = self.request() |
846 req.form = {'postlogin_path': '/elephants/babar'} |
846 req.form = {'postlogin_path': 'elephants/babar'} |
847 with self.assertRaises(Redirect) as cm: |
847 with self.assertRaises(Redirect) as cm: |
848 self.ctrl_publish(req, ctrl='login') |
848 self.ctrl_publish(req, ctrl='login') |
849 self.assertEqual('/elephants/babar', cm.exception.location) |
849 self.assertEqual(req.build_url('elephants/babar'), cm.exception.location) |
850 |
850 |
851 def test_login_no_dest(self): |
851 def test_login_no_dest(self): |
852 req = self.request() |
852 req = self.request() |
853 with self.assertRaises(Redirect) as cm: |
853 with self.assertRaises(Redirect) as cm: |
854 self.ctrl_publish(req, ctrl='login') |
854 self.ctrl_publish(req, ctrl='login') |
855 self.assertEqual('.', cm.exception.location) |
855 self.assertEqual(req.base_url(), cm.exception.location) |
856 |
856 |
857 if __name__ == '__main__': |
857 if __name__ == '__main__': |
858 unittest_main() |
858 unittest_main() |