Skip to content

Commit

Permalink
fix: default value not being taken into account correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncoulton committed Jun 22, 2017
1 parent bafe218 commit db24254
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/watson/form/support.py
Expand Up @@ -137,6 +137,7 @@ class FieldTypeForm(Form):
checkbox = fields.Checkbox(values=(('test', 1), ('testing', 2)))
radio = fields.Radio(values=(('test', 1), ('testing', 2)))
radio_enum = fields.Radio(values=TestEnum)
text = fields.Text(default_value='Test')
select = fields.Select(values=(('test', 1), ('testing', 2)))
select_multiple = fields.Select(
multiple=True, values=(('test', 1), ('testing', 2)))
1 change: 1 addition & 0 deletions tests/watson/form/test_forms.py
Expand Up @@ -255,5 +255,6 @@ def test_value_types(self):
assert form.radio == 3
assert form.select == 'test'
assert form.select_multiple == ['test', 'testing']
assert form.text == 'Test'
assert form.radio_enum == 'red'
assert '<input checked="checked" id="radio_enum_0"' in str(form.fields['radio_enum'])
2 changes: 1 addition & 1 deletion watson/form/__init__.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
__version__ = '4.1.0'
__version__ = '4.1.1'

try:
# Fix for setup.py version import
Expand Down
1 change: 1 addition & 0 deletions watson/form/fields.py
Expand Up @@ -154,6 +154,7 @@ def default_value(self):
def default_value(self, value):
if not self.value:
self.value = value
self._default_value = value

@property
def original_value(self):
Expand Down

0 comments on commit db24254

Please sign in to comment.