Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Button name cannot have space in it #14

merged 2 commits into from

3 participants


For example, if the button name is Log in, then the DOM id of generated button is deformLog in, which is invalid.


Can you add a test for this case?


added a test for this Button id fix

@mcdonc mcdonc merged commit 9bc5528 into Pylons:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 4, 2011
  1. @benzheren
Commits on May 20, 2011
  1. @benzheren

    add a test for button id fix

    benzheren committed
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 0 deletions.
  1. +3 −0  deform/
  2. +5 −0 deform/tests/
3  deform/
@@ -1,3 +1,5 @@
+import re
from deform import widget
from deform import field
@@ -134,6 +136,7 @@ def __init__(self, name='submit', title=None, type='submit', value=None,
if title is None:
title = name.capitalize()
+ name = re.sub(r'\s', '_', name)
if value is None:
value = name = name
5 deform/tests/
@@ -66,6 +66,11 @@ def test_ctor_value_None(self):
button = self._makeOne()
self.assertEqual(button.value, 'submit')
+ def test_name_with_space(self):
+ button = self._makeOne(name="log\tin as a user")
+ self.assertEquals(, 'log_in_as_a_user')
+ self.assertEquals(button.value, 'log_in_as_a_user')
def test_ctor(self):
button = self._makeOne(name='name', title='title',
type='type', value='value', disabled=True)
Something went wrong with that request. Please try again.