equal
deleted
inserted
replaced
1 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
1 # -*- coding: utf-8 -*- |
|
2 # copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
3 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
3 # |
4 # |
4 # This file is part of CubicWeb. |
5 # This file is part of CubicWeb. |
5 # |
6 # |
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
7 # CubicWeb is free software: you can redistribute it and/or modify it under the |
13 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
14 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more |
14 # details. |
15 # details. |
15 # |
16 # |
16 # You should have received a copy of the GNU Lesser General Public License along |
17 # You should have received a copy of the GNU Lesser General Public License along |
17 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
18 # with CubicWeb. If not, see <http://www.gnu.org/licenses/>. |
18 """ |
19 """cubicweb.web.webconfig unit tests""" |
19 |
20 |
20 """ |
|
21 import os |
21 import os |
22 |
22 |
23 from logilab.common.testlib import TestCase, unittest_main |
23 from logilab.common.testlib import TestCase, unittest_main |
24 |
|
25 from cubicweb.devtools import ApptestConfiguration, fake |
24 from cubicweb.devtools import ApptestConfiguration, fake |
26 |
25 |
27 class WebconfigTC(TestCase): |
26 class WebconfigTC(TestCase): |
28 def setUp(self): |
27 def setUp(self): |
29 self.config = ApptestConfiguration('data') |
28 self.config = ApptestConfiguration('data') |
43 rname = self.config.uiprops['FILE_ICON'].replace(self.config.datadir_url, '') |
42 rname = self.config.uiprops['FILE_ICON'].replace(self.config.datadir_url, '') |
44 self.assertTrue('file' in self.config.locate_resource(rname)[0].split(os.sep)) |
43 self.assertTrue('file' in self.config.locate_resource(rname)[0].split(os.sep)) |
45 cubicwebcsspath = self.config.locate_resource('cubicweb.css')[0].split(os.sep) |
44 cubicwebcsspath = self.config.locate_resource('cubicweb.css')[0].split(os.sep) |
46 self.assertTrue('web' in cubicwebcsspath or 'shared' in cubicwebcsspath) # 'shared' if tests under apycot |
45 self.assertTrue('web' in cubicwebcsspath or 'shared' in cubicwebcsspath) # 'shared' if tests under apycot |
47 |
46 |
|
47 def test_sign_text(self): |
|
48 signature = self.config.sign_text(u'hôp') |
|
49 self.assertTrue(self.config.check_text_sign(u'hôp', signature)) |
|
50 |
48 if __name__ == '__main__': |
51 if __name__ == '__main__': |
49 unittest_main() |
52 unittest_main() |
50 |
53 |
51 |
54 |