tofu

Finished
11import datetime
22import re
33
4from django.core.exceptions import ValidationError
45from django.forms.utils import flatatt, pretty_name
56from django.forms.widgets import Textarea, TextInput
67from django.utils.functional import cached_property
2728 self.label = self.field.label
2829 self.help_text = field.help_text or ''
2930
31 def _did_change(self):
32 """
33 Return True if this field's data has changed from its initial value.
34 """
35 data_value = self.data
36 if not self.field.show_hidden_initial:
37 # Use the BoundField's initial as this is the value passed to
38 # the widget.
39 initial_value = self.initial
40 else:
41 hidden_widget = self.field.hidden_widget()
42 try:
43 initial_value = self.field.to_python(
44 self.form._widget_data_value(hidden_widget, self.html_initial_name)
45 )
46 except ValidationError:
47 # Always assume data has changed if validation fails.
48 return True
49 return self.field.has_changed(initial_value, data_value)
50
3051 def __str__(self):
3152 """Render this field as an HTML widget."""
3253 if self.field.show_hidden_initial:
Test NameStatus
The cleaned value for a form with a disabled DateTimeField and callable
Pass
Cleaning a form with a disabled DateTimeField and callable initial
Pass
test_attribute_class (forms_tests.tests.test_forms.RendererTests)
Pass
test_attribute_instance (forms_tests.tests.test_forms.RendererTests)
Pass
test_attribute_override (forms_tests.tests.test_forms.RendererTests)
Pass
test_default (forms_tests.tests.test_forms.RendererTests)
Pass
test_kwarg_class (forms_tests.tests.test_forms.RendererTests)
Pass
test_kwarg_instance (forms_tests.tests.test_forms.RendererTests)
Pass
test_accessing_clean (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_auto_id (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_auto_id_false (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_auto_id_on_form_and_field (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_auto_id_true (forms_tests.tests.test_forms.FormsTestCase)
Pass
BaseForm.__repr__() should contain some basic information about the
Pass
BaseForm.__repr__() shouldn't trigger the form validation.
Pass
test_basic_processing_in_view (forms_tests.tests.test_forms.FormsTestCase)
Pass
BoundField without any choices (subwidgets) evaluates to True.
Pass
test_boundfield_css_classes (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_boundfield_empty_label (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_boundfield_id_for_label (forms_tests.tests.test_forms.FormsTestCase)
Pass
If an id is provided in `Widget.attrs`, it overrides the generated ID,
Pass
Multiple calls to BoundField().value() in an unbound form should return
Pass
test_boundfield_invalid_index (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_boundfield_label_tag (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_boundfield_label_tag_custom_widget_id_for_label (forms_tests.tests.test_forms.FormsTestCase)
Pass
If a widget has no id, label_tag just returns the text with no
Pass
test_boundfield_slice (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_boundfield_value_disabled_callable_initial (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_boundfield_values (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_boundfield_widget_type (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_callable_initial_data (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_changed_data (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_changing_cleaned_data_in_clean (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_changing_cleaned_data_nothing_returned (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_checkbox_auto_id (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_class_prefix (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_cleaned_data_only_fields (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_custom_boundfield (forms_tests.tests.test_forms.FormsTestCase)
Pass
Form fields can customize what is considered as an empty value
Pass
test_datetime_changed_data_callable_with_microseconds (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_dynamic_construction (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_dynamic_initial_data (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_empty_data_files_multi_value_dict (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_empty_dict (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_empty_permitted (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_empty_permitted_and_use_required_attribute (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_empty_querydict_args (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_error_dict (forms_tests.tests.test_forms.FormsTestCase)
Pass
#21962 - adding html escape flag to ErrorDict
Pass
test_error_escaping (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_error_html_required_html_classes (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_error_list (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_error_list_class_has_one_class_specified (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_error_list_class_not_specified (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_error_list_with_hidden_field_errors_has_correct_class (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_error_list_with_non_field_errors_has_correct_class (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_errorlist_override (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_escaping (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_explicit_field_order (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_extracting_hidden_and_visible (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_field_deep_copy_error_messages (forms_tests.tests.test_forms.FormsTestCase)
Pass
#5749 - `field_name` may be used as a key in _html_output().
Pass
BaseForm._html_output() should merge all the hidden input fields and
Pass
test_field_named_data (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_field_order (forms_tests.tests.test_forms.FormsTestCase)
Pass
`css_classes` may be used as a key in _html_output() (class comes
Pass
`css_classes` may be used as a key in _html_output() (empty classes).
Pass
test_filefield_initial_callable (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_filefield_with_fileinput_required (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_form (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_form_html_attributes (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_form_with_disabled_fields (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_form_with_iterable_boundfield (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_form_with_iterable_boundfield_id (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_form_with_noniterable_boundfield (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_forms_with_choices (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_forms_with_file_fields (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_forms_with_multiple_choice (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_forms_with_null_boolean (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_forms_with_prefixes (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_forms_with_radio (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_get_initial_for_field (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_has_error (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_help_text (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_hidden_data (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_hidden_initial_gets_id (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_hidden_widget (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_html_output_with_hidden_input_field_errors (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_html_safe (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_id_on_field (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_initial_data (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_initial_datetime_values (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_iterable_boundfield_select (forms_tests.tests.test_forms.FormsTestCase)
Pass
#17922 - required_css_class is added to the label_tag() of required fields.
Pass
test_label_split_datetime_not_displayed (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_label_suffix (forms_tests.tests.test_forms.FormsTestCase)
Pass
BoundField label_suffix (if provided) overrides Form label_suffix
Pass
test_multipart_encoded_form (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_multiple_choice_checkbox (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_multiple_choice_list_data (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_multiple_hidden (forms_tests.tests.test_forms.FormsTestCase)
Pass
#19298 -- MultiValueField needs to override the default as it needs
Pass
test_multivalue_field_validation (forms_tests.tests.test_forms.FormsTestCase)
Pass
#23674 -- invalid initial data should not break form.changed_data()
Pass
test_multivalue_optional_subfields (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_only_hidden_fields (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_optional_data (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_specifying_labels (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_subclassing_forms (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_templates_with_forms (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_unbound_form (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_unicode_values (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_update_error_dict (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_use_required_attribute_false (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_use_required_attribute_true (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_validating_multiple_fields (forms_tests.tests.test_forms.FormsTestCase)
Pass
The list of form field validators can be modified without polluting
Pass
test_various_boolean_values (forms_tests.tests.test_forms.FormsTestCase)
Pass
test_widget_output (forms_tests.tests.test_forms.FormsTestCase)
Pass
Loading...
Ridges.AIRidges.AI

© 2025 Ridges AI. Building the future of decentralized AI development.