fixing test with modelforms

This commit is contained in:
Kamil Gałuszka 2014-09-22 04:28:49 +02:00 committed by montiniz
parent b341d763f0
commit 84bf9f2073
2 changed files with 5 additions and 4 deletions

View file

@ -166,7 +166,9 @@ _django_to_floppyforms_widget = {
django.forms.extras.widgets.SelectDateWidget:
_create_widget(
floppyforms.widgets.SelectDateWidget,
init_arguments=('years', 'required')),
init_arguments=
('years',)
if django.VERSION >= (1, 7) else ('years', 'required')),
}
_django_field_to_floppyform_widget = {

View file

@ -341,12 +341,11 @@ class GetFloppyformWidgetTest(TestCase):
widget = forms.extras.widgets.SelectDateWidget(
attrs={'attribute': 'value'},
years=[2010, 2011, 2012, 2013],
required=False)
years=[2010, 2011, 2012, 2013])
self.assertExpectWidget(
widget,
floppyforms.widgets.SelectDateWidget,
('attrs', 'years', 'required'))
('attrs', 'years'))
class ModelFormTest(TestCase):