summaryrefslogtreecommitdiff
path: root/tests/forms_tests
AgeCommit message (Collapse)Author
2013-09-10Fixed test errors from 053de6131af83c63ec17d38578889c71de913d24 on py3.2.Florian Apolloner
2013-09-10Fixed #5749 -- Added field_name as a key in the _html_output dicte0ne
Thanks SmileyChris for the suggestion.
2013-09-09Removed unneeded imports in tests's __init__.py and unified them.Florian Apolloner
2013-09-06Fixed #4287 -- Fixed NaN and +/- Infinity handling in FloatFieldDaniel Langer
NaN, +Inf, and -Inf are no longer valid values for FloatFields.
2013-09-03Fixed "indentation is not a multiple of four" pep8 issues.Tim Graham
2013-08-30Fixed #20989 -- Removed useless explicit list comprehensions.Simon Charette
2013-08-28Fixed #20986 -- Enabled SelectDateWidget to use custom monthsLoic Bistuer
Reviewed by Trac alias MarkusH.
2013-08-16Combine consecutive with statementsClaude Paroz
Python 2.7 allows to combine several 'with' instructions.
2013-08-13Fixed #20555 -- Make subwidget id attribute availableMatt Johnson
In `BoundField.__iter__`, the widget's id attribute is now passed to each subwidget. A new id_for_label property was added to ChoiceInput.
2013-08-08Revert change to the default Form.clean()Marc Tamlyn
This means it doesn't break for people who are doing `cleaned_data = super(FooForm, self).clean()`.
2013-08-08Form.clean() does not need to return cleaned_data.Marc Tamlyn
If it does, that will be used as the cleaned_data. The default implementation has been changed to match this change.
2013-08-06Fixed #15511 -- Allow optional fields on ``MultiValueField` subclasses.Tai Lee
The `MultiValueField` class gets a new ``require_all_fields`` argument that defaults to ``True``. If set to ``False``, individual fields can be made optional, and a new ``incomplete`` validation error will be raised if any required fields have empty values. The ``incomplete`` error message can be defined on a `MultiValueField` subclass or on each individual field. Skip duplicate errors.
2013-08-05Fixed #20850 -- Added MultiWidget.needs_multipart_formTim Heap
2013-07-31Fixed #20649 -- Allowed blank field display to be defined in the initial ↵Alex Couper
list of choices.
2013-07-29Removed most of absolute_import importsClaude Paroz
Should be unneeded with Python 2.7 and up. Added some unicode_literals along the way.
2013-07-27Fixed a number of minor misspellings.Julien Phalip
2013-07-26Fixed #20805 -- Removed an extra colon beside checkboxes in the admin.Tim Graham
Thanks CollinAnderson for the report.
2013-07-22Fixed #20781 -- Fixed _has_changed regression with MultiValueFieldClaude Paroz
Thanks Tim Graham for the report.
2013-07-19Fixed #20765 -- Set small values of `step` using exponential notation.Simon Charette
Browsers parse small factors of 10 as 0 under decimal notation. Thanks to Trac alias matklad for the report and Claude Paroz for the review.
2013-07-13Fixed a deprecation warning in a selenium test.Tim Graham
2013-07-01Stopped using django.utils.unittest in the test suite.Aymeric Augustin
Refs #20680.
2013-06-22Fixed 17478 -- Allowed queryset overriding in BaseModelFormSet initClaude Paroz
BaseModelFormSet.forms is now a cached property instead of being populated in the __init__ method. This behaviour also matches an example in the documentation. Thanks Thomasz Swiderski for the report and Simon Charette for the review.
2013-06-20Fixed #20630 -- Removed `maxlength` attribute from `NumberInput`.Simon Charette
This attribute is only allowed on inputs of type "text", "search", "url", "tel", "email", or "password". Thanks to yoyoma for the report and @bmispelon for the review.
2013-06-18Fixed #20618 -- Fixed regression in `BoundField.label_tag`.Baptiste Mispelon
2013-06-16Fixed #20464 -- Added a `total_error_count` method on formsets.Baptiste Mispelon
Thanks to frog32 for the report and to Tim Graham for the review.
2013-06-14Fixed #20548 -- Removed all PendingDeprecationWarnings from django test suiteMarc Tamlyn
2013-06-10Fixed #18134 -- BoundField.label_tag now includes the form's label_suffixGabe Jackson
There was an inconsistency between how the label_tag for forms were generated depending on which method was used: as_p, as_ul and as_table contained code to append the label_suffix where as label_tag called on a form field directly did NOT append the label_suffix. The code for appending the label_suffix has been moved in to the label_tag code of the field and the HTML generation code for as_p, as_ul and as_table now calls this code as well. This is a backwards incompatible change because users who have added the label_suffix manually in their templates may now get double label_suffix characters in their forms.
2013-06-10Fixed available_apps for selenium tests.Aymeric Augustin
Refs #20483.
2013-06-06Fixed #12337 - Honor ModelForm.Meta.exclude when saving ManyToManyFields.Stephen Burrows
Thanks margieroginski for the report.
2013-06-06Fixed #20502 (again) -- More i18n cache flush in testsClaude Paroz
Thanks Timo Graham for noticing the failures.
2013-05-26Replaced `and...or...` constructs with PEP 308 conditional expressions.Ramiro Morales
2013-05-25Fixed #11725 -- Made possible to create widget label tag without "for"Claude Paroz
Thanks Denis Martinez for the report and initial patch, and Sergey Kolosov for bringing the patch up to date.
2013-05-22Fixed #18709 -- Check if initial_value is a callableJeroen Dekkers
In _get_changed_data, check if initial_value is a callable and call it if it is.
2013-05-21Use assertIsInstance in tests.Marc Tamlyn
Gives much nicer errors when it fails.
2013-05-20Fixed #20403 -- Ignore forms marked for deletion when validating max_num.Ryan Kaskel
2013-05-19Merge pull request #1094 from senko/ticket_11160Andrew Godwin
Fixed #11160: Formset non_form_errors returns ErrorList() if is_valid is not called
2013-05-18Fixed #20440 -- Ensured CharField's max_length/min_length are integersTome Cvitan
2013-05-18Added stripping of whitespace for SlugField and URLFieldDeni Bertovic
2013-05-18Fixed #11160 - Ensure full_clean is called from non_form_errorsSenko Rasic
Updated FormSet.non_form_errors() to ensure full_clean() has been called before returning the errors.
2013-05-09Fixed #19733 - deprecated ModelForms without 'fields' or 'exclude', and ↵Luke Plant
added '__all__' shortcut This also updates all dependent functionality, including modelform_factory and modelformset_factory, and the generic views `ModelFormMixin`, `CreateView` and `UpdateView` which gain a new `fields` attribute.
2013-04-16Refs #14567 -- Fixed failing test that wasn't being run.Carl Meyer
2013-04-13Fixed #17840 -- Generalized named placeholders in form error messagesClaude Paroz
Also fixed plural messages for DecimalField.
2013-04-13Fixed #4592: Made CheckboxSelectMultiple more like RadioSelectBaptiste Mispelon
I refactored RadioSelect and CheckboxSelectMultiple to make them inherit from a base class, allowing them to share the behavior of being able to iterate over their subwidgets. Thanks to Matt McClanahan for the initial patch and to Claude Paroz for the review.
2013-04-13Fixed #4117: Apply id attribute to the outer <ul> of RadioSelectBaptiste Mispelon
2013-04-13Fixed #19874: Apply id attribute to the outer <ul> of CheckboxSelectMultipleBaptiste Mispelon
2013-04-12Modified forms_tests to work with unittest2 discovery.Preston Timmons
2013-04-12Fixed #20211: Document backwards-incompatible change in BoundField.label_tagBaptiste Mispelon
Also cleaned up label escaping and consolidated the test suite regarding label_tag.
2013-04-02Move last remaining tests out of models.py files; prep for test discovery.Preston Timmons
2013-03-25Removed forced typecasting of help_text/label Field argumentsClaude Paroz
In any case, setting those variables to non-ascii utf-8 bytestrings is now considered a programming error.
2013-03-21Fixed #20084 -- Provided option to validate formset max_num on server.Andrew Gorcester
This is provided as a new "validate_max" formset_factory option defaulting to False, since the non-validating behavior of max_num is longstanding, and there is certainly code relying on it. (In fact, even the Django admin relies on it for the case where there are more existing inlines than the given max_num). It may be that at some point we want to deprecate validate_max=False and eventually remove the option, but this commit takes no steps in that direction. This also fixes the DoS-prevention absolute_max enforcement so that it causes a form validation error rather than an IndexError, and ensures that absolute_max is always 1000 more than max_num, to prevent surprising changes in behavior with max_num close to absolute_max. Lastly, this commit fixes the previous inconsistency between a regular formset and a model formset in the precedence of max_num and initial data. Previously in a regular formset, if the provided initial data was longer than max_num, it was truncated; in a model formset, all initial forms would be displayed regardless of max_num. Now regular formsets are the same as model formsets; all initial forms are displayed, even if more than max_num. (But if validate_max is True, submitting these forms will result in a "too many forms" validation error!) This combination of behaviors was chosen to keep the max_num validation simple and consistent, and avoid silent data loss due to truncation of initial data. Thanks to Preston for discussion of the design choices.