Skip to content

Commit

Permalink
make timeinputwidget tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdonc committed Oct 23, 2013
1 parent 0d882e6 commit e7bdd4d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions deformdemo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1271,9 +1271,8 @@ class Schema(colander.Schema):

schema = Schema()
form = deform.Form(schema, buttons=('submit',))
when = datetime.time(14, 35)

return self.render_form(form, appstruct={'time': when})
return self.render_form(form)

@view_config(renderer='templates/form.pt', name='datetimeinput')
@demonstrate('DateTime Input Widget')
Expand Down
5 changes: 2 additions & 3 deletions deformdemo/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,11 +556,10 @@ def test_render_default(self):
self.assertEqual(findcss('.required').text, 'Time')
self.assertEqual(findid('captured').text, 'None')
self.assertEqual(
findid('deformField1').get_attribute('value'), '14:35:00')
findid('deformField1').get_attribute('value'), u'')
self.assertRaises(NoSuchElementException, findcss, '.has-error')

def test_submit_empty(self):
findid('deformField1').clear()
findid("deformsubmit").click()
self.assertTrue(findcss('.has-error'))
self.assertEqual(findid('error-deformField1').text, 'Required')
Expand All @@ -569,7 +568,7 @@ def test_submit_empty(self):

def test_submit_tooearly(self):
findid('deformField1').click()
findxpath('//li[@data-pick="600"]').click()
findxpath('//li[@data-pick="0"]').click()
findid("deformsubmit").click()
self.assertTrue(findcss('.has-error'))
self.assertTrue('is earlier than' in findid('error-deformField1').text)
Expand Down

0 comments on commit e7bdd4d

Please sign in to comment.