author | Katia Saurfelt <katia.saurfelt@logilab.fr> |
Tue, 19 May 2009 12:07:03 +0200 | |
branch | stable |
changeset 1866 | 118c7528d08f |
parent 1802 | d628defebc17 |
child 1977 | 606923dff11b |
permissions | -rw-r--r-- |
0 | 1 |
import os |
2 |
||
3 |
from logilab.common.testlib import TestCase, unittest_main |
|
4 |
||
5 |
from cubicweb.devtools._apptest import FakeRequest |
|
6 |
from cubicweb.devtools import ApptestConfiguration |
|
7 |
||
8 |
class WebconfigTC(TestCase): |
|
9 |
def setUp(self): |
|
10 |
self.config = ApptestConfiguration('data') |
|
16
a70ece4d9d1a
fix tests in web/test
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
11 |
self.config._cubes = ['file'] |
0 | 12 |
self.config.load_configuration() |
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
16
diff
changeset
|
13 |
|
0 | 14 |
def test_nonregr_print_css_as_list(self): |
15 |
"""make sure PRINT_CSS *must* is a list""" |
|
16 |
config = self.config |
|
17 |
req = FakeRequest() |
|
18 |
print_css = req.external_resource('STYLESHEETS_PRINT') |
|
19 |
self.failUnless(isinstance(print_css, list)) |
|
20 |
ie_css = req.external_resource('IE_STYLESHEETS') |
|
21 |
self.failUnless(isinstance(ie_css, list)) |
|
22 |
||
23 |
def test_locate_resource(self): |
|
24 |
self.failUnless('FILE_ICON' in self.config.ext_resources) |
|
25 |
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
|
26 |
self.failUnless('file' in self.config.locate_resource(rname).split(os.sep)) |
0 | 27 |
cubicwebcsspath = self.config.locate_resource('cubicweb.css').split(os.sep) |
28 |
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
|
29 |
|
0 | 30 |
if __name__ == '__main__': |
31 |
unittest_main() |
|
32 |
||
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
16
diff
changeset
|
33 |