vendor/Five/1.2b-r20590

view browser/tests/skin.txt @ 0:3673ed425f80

Vendor import of Five 1.2b+ (r20590)
author fguillaume
date Fri, 02 Dec 2005 20:25:42 +0000
parents
children
line source
1 Test layer and skin support
2 ===========================
4 Let's register a test layer and test skin:
6 >>> import Products.Five.browser.tests
7 >>> from Products.Five import zcml
8 >>> zcml.load_config("configure.zcml", Products.Five)
9 >>> zcml.load_config("skin.zcml", package=Products.Five.browser.tests)
11 Let's add a test object that we'll access the test page from:
13 >>> from Products.Five.tests.testing.simplecontent import manage_addSimpleContent
14 >>> manage_addSimpleContent(self.folder, 'testoid', 'Testoid')
16 The view was registered on a different layer than 'default', that's
17 why we can't access it straight away:
19 >>> print http(r"""
20 ... GET /test_folder_1_/testoid/eagle.html HTTP/1.1
21 ... """)
22 HTTP/1.1 404 Not Found
23 ...
25 It works when we explicitly use the skin that includes that layer:
27 >>> print http(r"""
28 ... GET /test_folder_1_/testoid/++skin++TestSkin/eagle.html HTTP/1.1
29 ... """)
30 HTTP/1.1 200 OK
31 ...
32 The eagle has landed
34 Or when we make that skin the default skin:
36 >>> zcml.load_string('''
37 ... <browser:defaultSkin
38 ... xmlns:browser="http://namespaces.zope.org/browser"
39 ... name="TestSkin" />
40 ... ''')
42 >>> print http(r"""
43 ... GET /test_folder_1_/testoid/eagle.html HTTP/1.1
44 ... """)
45 HTTP/1.1 200 OK
46 ...
47 The eagle has landed
50 Clean up
51 --------
53 >>> from zope.app.tests.placelesssetup import tearDown
54 >>> tearDown()