Exemplo n.º 1
0
 def test_it(self):
     from eucaconsole.views import BaseView
     f = BaseView.escape_braces('{{ hello world }}')
     res = f(None, None)
     self.assertEqual(len(res), 1)
     self.assertEqual(res[0].value.s,
                      '{{ hello world }}')
Exemplo n.º 2
0
 def test_path_redirect(self):
     url = 'http://www.example.com/foo/bar'
     self.assertEqual(BaseView.sanitize_url(url), '/foo/bar')
Exemplo n.º 3
0
 def test_redirect_with_extra_slash_in_scheme(self):
     unsafe_url = 'http:///www.example.com/'
     self.assertEqual(BaseView.sanitize_url(unsafe_url), '/')
Exemplo n.º 4
0
 def test_it(self):
     from eucaconsole.views import BaseView
     f = BaseView.escape_braces('{{ hello world }}')
     res = f(None, None)
     self.assertEqual(len(res), 1)
     self.assertEqual(res[0].value.s, '{{ hello world }}')
Exemplo n.º 5
0
 def test_path_redirect(self):
     url = 'http://www.example.com/foo/bar'
     self.assertEqual(BaseView.sanitize_url(url), '/foo/bar')
Exemplo n.º 6
0
 def test_redirect_with_extra_slash_in_scheme(self):
     unsafe_url = 'http:///www.example.com/'
     self.assertEqual(BaseView.sanitize_url(unsafe_url), '/')