author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Fri, 05 Jun 2009 15:06:55 +0200 | |
changeset 2057 | 0a0cbccafcb5 |
parent 1977 | 606923dff11b |
child 2773 | b2530e3e0afb |
child 4212 | ab6573088b4a |
permissions | -rw-r--r-- |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
1 |
""" |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
2 |
|
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
3 |
:organization: Logilab |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
4 |
:copyright: 2001-2009 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
5 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
6 |
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1802
diff
changeset
|
7 |
""" |
0 | 8 |
import os |
9 |
||
10 |
from logilab.common.testlib import TestCase, unittest_main |
|
11 |
||
12 |
from cubicweb.devtools._apptest import FakeRequest |
|
13 |
from cubicweb.devtools import ApptestConfiguration |
|
14 |
||
15 |
class WebconfigTC(TestCase): |
|
16 |
def setUp(self): |
|
17 |
self.config = ApptestConfiguration('data') |
|
16
a70ece4d9d1a
fix tests in web/test
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
18 |
self.config._cubes = ['file'] |
0 | 19 |
self.config.load_configuration() |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
16
diff
changeset
|
20 |
|
0 | 21 |
def test_nonregr_print_css_as_list(self): |
22 |
"""make sure PRINT_CSS *must* is a list""" |
|
23 |
config = self.config |
|
24 |
req = FakeRequest() |
|
25 |
print_css = req.external_resource('STYLESHEETS_PRINT') |
|
26 |
self.failUnless(isinstance(print_css, list)) |
|
27 |
ie_css = req.external_resource('IE_STYLESHEETS') |
|
28 |
self.failUnless(isinstance(ie_css, list)) |
|
29 |
||
30 |
def test_locate_resource(self): |
|
31 |
self.failUnless('FILE_ICON' in self.config.ext_resources) |
|
32 |
rname = self.config.ext_resources['FILE_ICON'].replace('DATADIR/', '') |
|
16
a70ece4d9d1a
fix tests in web/test
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
33 |
self.failUnless('file' in self.config.locate_resource(rname).split(os.sep)) |
0 | 34 |
cubicwebcsspath = self.config.locate_resource('cubicweb.css').split(os.sep) |
35 |
self.failUnless('web' in cubicwebcsspath or 'shared' in cubicwebcsspath) # 'shared' if tests under apycot |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
16
diff
changeset
|
36 |
|
0 | 37 |
if __name__ == '__main__': |
38 |
unittest_main() |
|
39 |
||
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
16
diff
changeset
|
40 |