author | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> |
Mon, 10 Nov 2008 19:33:55 +0100 | |
changeset 16 | a70ece4d9d1a |
parent 0 | b97547f5f1fa |
child 1802 | d628defebc17 |
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() |
13 |
||
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 |
|
29 |
||
30 |
if __name__ == '__main__': |
|
31 |
unittest_main() |
|
32 |
||
33 |