Commits

Ralph Bean committed 4a9d47b

100% test coverage

Comments (0)

Files changed (5)

 
 *.egg-info
 .coverage
+htmlcov
 *.pyc
 *~
 *.swp
     zip_safe=False,
     include_package_data=True,
     test_suite = 'nose.collector',
+    tests_require = [
+        'WebTest',
+        'BeautifulSoup',
+        'nose',
+        'formencode',
+        'strainer',
+        'mako',
+        'genshi',
+    ],
     entry_points="""
         [tw2.widgets]
         # Register your widgets so they can be listed in the WidgetBrowser

tests/test_widgets.py

+from tw2.etc.widgets import *
+from tw2.core.testbase import assert_in_xml, assert_eq_xml, WidgetTest
+
+class TestIFrameWidget(WidgetTest):
+    widget = IFrameWidget
+    attrs = {'url' : 'foo'}
+    expected = """
+<div>
+<iframe src="foo" height="100%" width="100%">
+<p>Your browser does not support iframes.</p>
+</iframe>
+</div>"""

tw2/etc/templates/iframe.html

+<div xmlns="http://www.w3.org/1999/xhtml"
+     xmlns:py="http://genshi.edgewall.org/">
+<h1 py:if="w.title">${w.title}</h1>
+<iframe py:attrs="w.attrs">
+<p>Your browser does not support iframes.</p>
+</iframe>
+</div>

tw2/etc/templates/iframe.mak

 <%namespace name="tw" module="tw2.core.mako_util"/>\
+<div>
 % if w.title:
 <h1>${w.title}</h1>
 % endif
 <iframe ${tw.attrs(attrs=w.attrs)}>
 <p>Your browser does not support iframes.</p>
 </iframe>
+</div>