--- a/web/test/unittest_form.py Thu Feb 19 22:17:22 2009 +0100
+++ b/web/test/unittest_form.py Thu Feb 19 22:17:39 2009 +0100
@@ -5,24 +5,18 @@
class CustomChangeStateForm(ChangeStateForm):
hello = IntField(name='youlou')
-
+ creation_date = DateTimeField(widget=DateTimePicker)
+
class EntityFieldsFormTC(EnvBasedTC):
def setUp(self):
super(EntityFieldsFormTC, self).setUp()
-## def next_tabindex(self):
-## self.count += 1
-## return self.count
-## self.req = mock_object(build_url=lambda *args,**kwargs: 'myurl.com/pouet',
-## url=lambda *args,**kwargs: 'myurl.com/form',
-## _=lambda s,x: x, form={}, data={},
-## next_tabindex=next_tabindex, count=0)
-## self.entity = mock_object(eid=1, has_eid=lambda x: False, id='Entity')
+ self.req = self.request()
+ self.entity = self.user(self.req)
def test(self):
- req = self.request()
- form = ChangeStateForm(req, redirect_path='perdu.com')
- self.assertEquals(form.form_render(self.user(req), state=123),
+ form = ChangeStateForm(self.req, redirect_path='perdu.com')
+ self.assertEquals(form.form_render(self.entity, state=123),
''' ''')
def test_form_inheritance(self):