Permalink
Browse files

Added Unit Test

  • Loading branch information...
1 parent 4920ab0 commit 5641bea6e01f851fc1e2b129873d0d52b1de1f04 @gregjurman gregjurman committed Feb 20, 2012
Showing with 17 additions and 17 deletions.
  1. +0 −4 setup.cfg
  2. +9 −0 setup.py
  3. 0 tests/__init__.py
  4. +8 −13 tests/test_widget.py
View
@@ -1,6 +1,2 @@
-[egg_info]
-tag_build = dev
-tag_date = true
-
[nosetests]
where = tests
View
@@ -18,6 +18,15 @@
namespace_packages = ['tw2'],
zip_safe=False,
include_package_data=True,
+ tests_require = [
+ 'nose',
+ 'BeautifulSoup',
+ 'Genshi',
+ 'mako',
+ # formencode isn't actually needed, but is just here to patch up
+ # tw2.forms
+ 'strainer',
+ ],
test_suite = 'nose.collector',
entry_points="""
[tw2.widgets]
View
No changes.
View
@@ -1,16 +1,11 @@
-from tw.core.testutil import WidgetTestCase
-from tw.dyntext import *
+from tw2.core.testbase import WidgetTest
+from tw2.dyntext import *
-class TestWidget(WidgetTestCase):
+class TestDemoWidget(WidgetTest):
# place your widget at the TestWidget attribute
- TestWidget = Dyntext
- # Initilization args. go here
- widget_kw = {}
+ widget = DynamicTextWidget
- def test_render(self):
- # Asserts 'foo' and 'test' (the test widget's id) appear in rendered
- # string when 'foo' is passed as value to render
- self.assertInOutput(['foo', 'test'], "foo")
- # Asserts 'ohlalala' does not appear in rendered string when render
- # is called without args
- self.assertNotInOutput(['ohlalala'])
+ # Initilization args. go here
+ attrs = {'id' : 'affected_count'}
+ params = {'data_url' : '/stats/affected_count'}
+ expected = """<span id="affected_count"></span>"""

0 comments on commit 5641bea

Please sign in to comment.