Author: jmorliaguet
Date: Wed Mar 22 16:19:11 2006
New Revision: 2689

Removed:
   cpsskins/branches/jmo-perspectives/tests/test_portlet.py
Modified:
   cpsskins/branches/jmo-perspectives/doc/portlet-ordering.txt
   cpsskins/branches/jmo-perspectives/doc/portlet-rendering.txt
   cpsskins/branches/jmo-perspectives/ftests/test_portlet.py
   cpsskins/branches/jmo-perspectives/tests/setup.py
   cpsskins/branches/jmo-perspectives/ui/standard/filters/widget/widgets.py
Log:

- ftests fixes



Modified: cpsskins/branches/jmo-perspectives/doc/portlet-ordering.txt
==============================================================================
--- cpsskins/branches/jmo-perspectives/doc/portlet-ordering.txt (original)
+++ cpsskins/branches/jmo-perspectives/doc/portlet-ordering.txt Wed Mar 22 
16:19:11 2006
@@ -24,7 +24,7 @@
 The slots A and B have their own display
 
     >>> from cpsskins.elements.interfaces import IDisplayable
-    >>> from cpsskins.ui.default.displays.boxgroup import BoxGroup
+    >>> from cpsskins.ui.standard.displays.boxgroup import BoxGroup
 
     >>> display_slot_A = IDisplayable(slot_A).getDisplay()
     >>> display_slot_B = IDisplayable(slot_B).getDisplay()

Modified: cpsskins/branches/jmo-perspectives/doc/portlet-rendering.txt
==============================================================================
--- cpsskins/branches/jmo-perspectives/doc/portlet-rendering.txt        
(original)
+++ cpsskins/branches/jmo-perspectives/doc/portlet-rendering.txt        Wed Mar 
22 16:19:11 2006
@@ -61,14 +61,14 @@
    it corresponds to the 'view' in the MVC paradigm.
 
     >>> from zope.interface.verify import verifyClass
-    >>> from cpsskins.ui.default.displays.box import Box
-    >>> from cpsskins.ui.default.displays.interfaces import IDisplay
+    >>> from cpsskins.ui.standard.displays.box import Box
+    >>> from cpsskins.ui.standard.displays.interfaces import IDisplay
     >>> verifyClass(IDisplay, Box)
     True
 
     the box is then formatted with a widget.
 
-    >>> from cpsskins.ui.default.formats.widget import Widget
+    >>> from cpsskins.ui.standard.formats.widget import Widget
     >>> from cpsskins.elements.interfaces import IFormat
     >>> verifyClass(IFormat, Widget)
     True
@@ -79,12 +79,12 @@
 3) The portlet is finally rendered by passing the data to the filter
    (here a widget filter):
 
-    >>> rendered = '<h1>Test of HTML</h1>'
+    >>> rendered = u'<h1>Test of HTML</h1>'
 
 the widget filter adapts the widget providing a view:
 
-    >>> from cpsskins.ui.default.filters.widget import WidgetFilter
-    >>> from cpsskins.ui.default.formats.widget import IWidget
+    >>> from cpsskins.ui.standard.filters.widget import WidgetFilter
+    >>> from cpsskins.ui.standard.formats.widget import IWidget
     >>> from cpsskins.browser.rendering.interfaces import IFilterView
 
     >>> ztapi.provideAdapter(IWidget, IFilterView, WidgetFilter)
@@ -94,7 +94,7 @@
     ...    return widget_filter(rendered, info)
 
     >>> test_render(widget, rendered, info)
-    '<div><h1>Test of HTML</h1></div>'
+    u'<div><h1>Test of HTML</h1></div>'
 
 Available widgets:
 ==================
@@ -110,31 +110,31 @@
     ----------------
     >>> widget = Widget('vertical_menu')
     >>> test_render(widget, rendered, info)
-    '<ul class="verticalMenu"><li><a href="@@urlA.html">Item A</a></li><li><a 
href="@@urlB.html">Item B</a></li></ul>'
+    u'<ul class="verticalMenu"><li><a href="@@urlA.html">Item A</a></li><li><a 
href="@@urlB.html">Item B</a></li></ul>'
 
     b) horizontal tabs
     ------------------
     >>> widget = Widget('horizontal_tabs')
     >>> test_render(widget, rendered, info)
-    '<ul class="horizontalTabs"><li><a href="@@urlA.html">Item 
A</a></li><li><a href="@@urlB.html">Item B</a></li></ul>'
+    u'<ul class="horizontalTabs"><li><a href="@@urlA.html">Item 
A</a></li><li><a href="@@urlB.html">Item B</a></li></ul>'
 
     c) Menu bar
     -------------------
     >>> widget = Widget('menu_bar')
     >>> test_render(widget, rendered, info)
-    '<div class="menuBar"><a href="@@urlA.html">Item A</a><a 
href="@@urlB.html">Item B</a></div>'
+    u'<div class="menuBar"><a href="@@urlA.html">Item A</a><a 
href="@@urlB.html">Item B</a></div>'
 
     d) Horizontal trail
     -------------------
     >>> widget = Widget('horizontal_trail')
     >>> test_render(widget, rendered, info)
-    '<div class="horizontalTrail"><a href="@@urlA.html">Item A</a><span 
class="sep">&gt;</span><a href="@@urlB.html">Item B</a><span 
class="sep">&gt;</span></div>'
+    u'<div class="horizontalTrail"><a href="@@urlA.html">Item A</a><span 
class="sep">&gt;</span><a href="@@urlB.html">Item B</a><span 
class="sep">&gt;</span></div>'
 
     e) Drop-down list
     -----------------
     >>> widget = Widget('dropdown_list')
     >>> test_render(widget, rendered, info)
-    '<form action="@@cpsskins_redirect" method="post"><select 
onchange="submit()" name="url"><option value="./"></option><option 
value="@@urlA.html">Item A</option><option value="@@urlB.html">Item 
B</option></select></form>'
+    u'<form action="@@cpsskins_redirect" method="post"><select 
onchange="submit()" name="url"><option value="./"></option><option 
value="@@urlA.html">Item A</option><option value="@@urlB.html">Item 
B</option></select></form>'
 
 
 Widgets displaying HTML markup
@@ -148,37 +148,37 @@
     >>> info.metadata = MetaData(title=u'Example frame box')
     >>> widget = Widget('frame_box')
     >>> test_render(widget, rendered, info)
-    '<fieldset><legend>Example frame box</legend><div><h1>Test of 
HTML</h1></div></fieldset>'
+    u'<fieldset><legend>Example frame box</legend><div><h1>Test of 
HTML</h1></div></fieldset>'
 
     b) horizontal scrollbar
     -----------------------
     >>> widget = Widget('horizontal_scrollbar')
     >>> test_render(widget, rendered, info)
-    '<div style="overflow-x:scroll;"><h1>Test of HTML</h1></div>'
+    u'<div style="overflow-x:scroll;"><h1>Test of HTML</h1></div>'
 
     c) table frame
     --------------
     >>> widget = Widget('table_frame')
     >>> test_render(widget, rendered, info)
-    '<table summary=""><tr><h1>Test of HTML</h1></tr></table>'
+    u'<table summary=""><tr><h1>Test of HTML</h1></tr></table>'
 
     d) table cell
     --------------
     >>> widget = Widget('table_cell')
     >>> test_render(widget, rendered, info)
-    '<td style="vertical-align:top;"><h1>Test of HTML</h1></td>'
+    u'<td style="vertical-align:top;"><h1>Test of HTML</h1></td>'
 
     e) div frame (tableless renderering)
     ------------------------------------
     >>> widget = Widget('div_frame')
     >>> test_render(widget, rendered, info)
-    '<div><h1>Test of HTML</h1><br style="clear:left"/></div><div 
style="clear:left"></div>'
+    u'<div><h1>Test of HTML</h1><br style="clear:left"/></div><div 
style="clear:left"></div>'
 
     f) div cell (tableless rendering)
     ---------------------------------
     >>> widget = Widget('div_cell')
     >>> test_render(widget, rendered, info)
-    '<div style="float:left;overflow-x:hidden"><h1>Test of HTML</h1></div>'
+    u'<div style="float:left;overflow-x:hidden"><h1>Test of HTML</h1></div>'
 
 
 Widgets displaying images
@@ -191,6 +191,6 @@
     --------
     >>> widget = Widget('image')
     >>> test_render(widget, rendered, info)
-    '<img src="/some/image.png" alt="" style="border: none" />'
+    u'<img src="/some/image.png" alt="" style="border: none" />'
 
 

Modified: cpsskins/branches/jmo-perspectives/ftests/test_portlet.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ftests/test_portlet.py   (original)
+++ cpsskins/branches/jmo-perspectives/ftests/test_portlet.py   Wed Mar 22 
16:19:11 2006
@@ -26,6 +26,8 @@
 
 def test_suite():
     return unittest.TestSuite((
+        FunctionalDocFileSuite('../doc/local-portlets.txt', setUp=setUp),
+        FunctionalDocFileSuite('../doc/portlet-rendering.txt', setUp=setUp),
         FunctionalDocFileSuite('../doc/portlet-ordering.txt', setUp=setUp),
         ))
 

Modified: cpsskins/branches/jmo-perspectives/tests/setup.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/tests/setup.py   (original)
+++ cpsskins/branches/jmo-perspectives/tests/setup.py   Wed Mar 22 16:19:11 2006
@@ -21,6 +21,7 @@
 from zope.app.traversing.interfaces import IPathAdapter
 from zope.app.event.interfaces import IObjectCreatedEvent, IObjectModifiedEvent
 from zope.app.container.interfaces import IObjectAddedEvent, 
IObjectRemovedEvent
+from zope.configuration.xmlconfig import XMLConfig
 
 from cpsskins.thememanager import ThemeManagement
 from cpsskins import controllers

Modified: 
cpsskins/branches/jmo-perspectives/ui/standard/filters/widget/widgets.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/standard/filters/widget/widgets.py    
(original)
+++ cpsskins/branches/jmo-perspectives/ui/standard/filters/widget/widgets.py    
Wed Mar 22 16:19:11 2006
@@ -70,7 +70,7 @@
     """Display the data with minimal formatting.
     """
 
-    _preview = '<div>' \
+    _preview = u'<div>' \
                '<h1 label="H1">Header level 1</h1>' \
                '<h2 label="H2">Header level 2</h2>' \
                '<h3 label="H3">Header level 3</h3>' \
@@ -92,7 +92,7 @@
     """
     def __call__(self, markup, info, **kw):
         data = info.data
-        return '<a href="%s">%s</a>' % (data.url, data.title)
+        return u'<a href="%s">%s</a>' % (data.url, data.title)
 
 class BasicItemsView(WidgetView):
     """Display a series of items with minimal formatting
@@ -103,7 +103,7 @@
         items_append = markup.append
         for item in data:
             items_append('<a href="%s">%s</a>' % (item.url, item.title))
-        return ''.join(markup)
+        return u''.join(markup)
 
 
 # Advanced views
@@ -111,30 +111,30 @@
 class Image(WidgetView):
     """Display an image
     """
-    _preview = '<img src="#" alt="" style="border: none" />'
+    _preview = u'<img src="#" alt="" style="border: none" />'
 
     def __call__(self, markup, info, **kw):
         data = info.data
         markup = ''
         url = data.path or data.url
         if url:
-            markup = '<img src="%s" alt="" style="border: none" />' % url
+            markup = u'<img src="%s" alt="" style="border: none" />' % url
         else:
-            markup = '<div>No image</div>' # XXX use an image.
+            markup = u'<div>No image</div>' # XXX use an image.
         # TODO: rendering optional link
         return markup
 
 class PageBody(HTMLView):
     """The page's <body> tag
     """
-    _markup = '<body>%(content)s</body>'
-    _preview = '<body>Page content</body>'
+    _markup = u'<body>%(content)s</body>'
+    _preview = u'<body>Page content</body>'
 
 class VerticalMenu(MenuView):
-    _start = '<ul class="verticalMenu">'
-    _repeat = '<li><a href="%(url)s">%(title)s</a></li>'
-    _end = '</ul>'
-    _preview = '<ul label="menu box" class="verticalMenu">' \
+    _start = u'<ul class="verticalMenu">'
+    _repeat = u'<li><a href="%(url)s">%(title)s</a></li>'
+    _end = u'</ul>'
+    _preview = u'<ul label="menu box" class="verticalMenu">' \
                '<li label="menu item">' \
                '<a label="link" href="#">First item</a></li>' \
                '<li label="menu item">' \
@@ -144,10 +144,10 @@
                '</ul>'
 
 class HorizontalTabs(MenuView):
-    _start = '<ul class="horizontalTabs">'
-    _repeat = '<li><a href="%(url)s">%(title)s</a></li>'
-    _end = '</ul>'
-    _preview = '<ul label="menu box" class="horizontalTabs">' \
+    _start = u'<ul class="horizontalTabs">'
+    _repeat = u'<li><a href="%(url)s">%(title)s</a></li>'
+    _end = u'</ul>'
+    _preview = u'<ul label="menu box" class="horizontalTabs">' \
                '<li label="menu tab">' \
                '<a label="link" href="#">First item</a></li>' \
                '<li label="menu tab">' \
@@ -157,10 +157,10 @@
                '</ul>'
 
 class MenuBar(MenuView):
-    _start = '<div class="menuBar">'
-    _repeat = '<a href="%(url)s">%(title)s</a>'
-    _end = '</div>'
-    _preview = '<ul label="menu bar" class="menuBar">' \
+    _start = u'<div class="menuBar">'
+    _repeat = u'<a href="%(url)s">%(title)s</a>'
+    _end = u'</div>'
+    _preview = u'<ul label="menu bar" class="menuBar">' \
                '<li label="menu item">' \
                '<a label="link" href="#">First item</a></li>' \
                '<li label="menu item">' \
@@ -170,11 +170,11 @@
                '</ul>'
 
 class HorizontalTrail(MenuView):
-    _start = '<div class="horizontalTrail">'
-    _repeat = '<a href="%(url)s">%(title)s</a>'
-    _separator = '<span class="sep">&gt;</span>'
-    _end = '</div>'
-    _preview = '<div label="box" class="horizontalTrail">' \
+    _start = u'<div class="horizontalTrail">'
+    _repeat = u'<a href="%(url)s">%(title)s</a>'
+    _separator = u'<span class="sep">&gt;</span>'
+    _end = u'</div>'
+    _preview = u'<div label="box" class="horizontalTrail">' \
                '<a label="trail item" href="#">First item</a>' \
                '<span label="separator" class="sep">&gt;</span>' \
                '<a label="trail item" href="#">Second item</a>' \
@@ -184,19 +184,19 @@
                '</div>'
 
 class DropDownList(MenuView):
-    _start = '<form action="@@cpsskins_redirect" method="post">' \
+    _start = u'<form action="@@cpsskins_redirect" method="post">' \
              '<select onchange="submit()" name="url">' \
              '<option value="./"></option>'
-    _repeat = '<option value="%(url)s">%(title)s</option>'
-    _end = '</select></form>'
-    _preview = '<form label="selector"><select label="item selector">' \
+    _repeat = u'<option value="%(url)s">%(title)s</option>'
+    _end = u'</select></form>'
+    _preview = u'<form label="selector"><select label="item selector">' \
                '<option label="list item">First item</option>' \
                '<option label="list item">Second item</option>' \
                '<option label="list item">Third item</option>' \
                '</select></form>'
 
 class FrameBox(HTMLView):
-    _preview = '<fieldset label="box">' \
+    _preview = u'<fieldset label="box">' \
                '<legend label="legend">Box title</legend>' \
                'Sample content.' \
                '<a label="link" href="#">some link</a>' \
@@ -213,14 +213,14 @@
 class HorizontalScrollBar(HTMLView):
     """Display horizontal scroll bars in case of horizontal overflow
     """
-    _markup = '<div style="overflow-x:scroll;">%(content)s</div>'
-    _preview = '<div label="box" style="overflow-x:scroll;">Box content</div>'
+    _markup = u'<div style="overflow-x:scroll;">%(content)s</div>'
+    _preview = u'<div label="box" style="overflow-x:scroll;">Box content</div>'
 
 class TableFrame(HTMLView):
     """Display a <table><tr> tag
     """
-    _markup = '<table summary=""><tr>%(content)s</tr></table>'
-    _preview = '<table summary="" label="table frame">' \
+    _markup = u'<table summary=""><tr>%(content)s</tr></table>'
+    _preview = u'<table summary="" label="table frame">' \
                '<tbody inactive="1"><tr inactive="1">' \
                '<td inactive="1">Sample content</td>' \
                '</tr></tbody></table>'
@@ -228,8 +228,8 @@
 class TableCell(HTMLView):
     """Display a <td> tag
     """
-    _markup = '<td style="vertical-align:top;">%(content)s</td>'
-    _preview = '<table summary="" ignore="1" inactive="1">' \
+    _markup = u'<td style="vertical-align:top;">%(content)s</td>'
+    _preview = u'<table summary="" ignore="1" inactive="1">' \
                '<tbody ignore="1" inactive="1">' \
                '<tr ignore="1" inactive="1">' \
                '<td label="cell">Cell content</td>' \
@@ -238,21 +238,21 @@
 class DivFrame(HTMLView):
     """Display a <div> frame
     """
-    _markup = '<div>%(content)s<br style="clear:left"/></div>' \
+    _markup = u'<div>%(content)s<br style="clear:left"/></div>' \
               '<div style="clear:left"></div>'
-    _preview = '<div label="frame box">Frame content</div>'
+    _preview = u'<div label="frame box">Frame content</div>'
 
 class DivCell(HTMLView):
     """Display a floating <div> cell
     """
-    _markup = '<div style="float:left;overflow-x:hidden">%(content)s</div>'
-    _preview = '<div label="cell">Cell content</div>'
+    _markup = u'<div style="float:left;overflow-x:hidden">%(content)s</div>'
+    _preview = u'<div label="cell">Cell content</div>'
 
 class MonthlyCalendar(WidgetView):
     """Display a monthly calendar
     """
-    _markup = 'Not done yet'
-    _preview = '<table label="calendar" class="calendar">' \
+    _markup = u'Not done yet'
+    _preview = u'<table label="calendar" class="calendar">' \
                '<thead><tr label="header">' \
                '<th>Mo</th><th>Tu</th><th>We</th><th>Th</th>' \
                '<th>Fr</th><th>Sa</th><th>Su</th></tr></thead>' \
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to