Changeset 7517
- Timestamp:
- 05/05/08 13:08:07 (2 weeks ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/newforms-admin/django/newforms/widgets.py
r7515 r7517 592 592 initial = self.decompress(initial) 593 593 for widget, initial, data in zip(self.widgets, initial, data): 594 if notwidget._has_changed(initial, data):595 return False596 return True594 if widget._has_changed(initial, data): 595 return True 596 return False 597 597 598 598 def format_output(self, rendered_widgets): django/branches/newforms-admin/tests/regressiontests/forms/widgets.py
r7515 r7517 964 964 965 965 >>> w = MyMultiWidget(widgets=(TextInput(), TextInput())) 966 >>> w._has_changed(None, ['john', 'lennon']) 967 True 968 >>> w._has_changed('john__lennon', ['john', 'lennon']) 969 False 966 # test with no initial data 967 >>> w._has_changed(None, [u'john', u'lennon']) 968 True 969 # test when the data is the same as initial 970 >>> w._has_changed(u'john__lennon', [u'john', u'lennon']) 971 False 972 # test when the first widget's data has changed 973 >>> w._has_changed(u'john__lennon', [u'alfred', u'lennon']) 974 True 975 # test when the last widget's data has changed. this ensures that it is not 976 # short circuiting while testing the widgets. 977 >>> w._has_changed(u'john__lennon', [u'john', u'denver']) 978 True 970 979 971 980 # SplitDateTimeWidget #########################################################
