summaryrefslogtreecommitdiff
path: root/tests/model_forms/tests.py
Commit message (Collapse)AuthorAgeFilesLines
* Used 4 space hanging indent for dictionaries.Tim Graham2019-01-021-9/+19
| | | Thanks Mariusz Felisiak for auditing.
* Switched setUp() to setUpTestData() where possible in Django's tests.Simon Charette2018-11-271-6/+8
|
* Switched TestCase to SimpleTestCase where possible in Django's tests.Tim Graham2018-11-271-1/+1
|
* Refs #13091 -- Added test for commit=False idiom with partial ↵Carlton Gibson2018-07-251-0/+28
| | | | unique_together validation.
* Fixed #28312 -- Made ModelChoiceIterator.__len__() more memory-efficient.François Freitag2018-04-231-1/+1
| | | | | | | | | Instead of loading all QuerySet results in memory, count the number of entries. This adds an extra query when list() or tuple() is called on the choices (because both call __len__() then __iter__()) but uses less memory since the QuerySet results won't be cached. In most cases, the choices will only be iterated on, meaning that __len__() won't be called and only one query will be executed.
* Fixed #29279 -- Added renderer argument to ModelForm.Dan Watson2018-03-311-0/+4
|
* Fixed hanging indentation in various code.Mariusz Felisiak2018-03-161-58/+58
|
* Fixed #29158 -- Fixed len(choices) crash if ModelChoiceField's queryset is a ↵François Freitag2018-03-011-1/+1
| | | | | | | manager. Removing all() in __iter__() prevents a duplicate query when choices are cast to a list and there's a prefetch_related().
* Consolidated ModelChoiceField tests.François Freitag2018-03-011-258/+2
|
* Eliminated the need to modify a model forms test when new test files are added.Tim Graham2018-02-281-6/+2
|
* Fixed #29038 -- Removed closing slash from HTML void tags.Jon Dufresne2018-01-211-58/+58
|
* Fixed #29041 -- Changed SelectMultiple's multiple attribute to HTML5 boolean ↵Jon Dufresne2018-01-201-8/+8
| | | | syntax.
* Fixed #28543 -- Prevented ManyToManyField.value_from_object() from being lazy.Tim Graham2017-08-311-0/+15
| | | | | | | Previously, it was a QuerySet which could reevaluate to a new value if the model's data changes. This is inconsistent with other Field.value_from_object() methods. This allows reverting the fix in the admin for refs #27998.
* Used assertRaisesMessage() to test Django's error messages.Mads Jensen2017-07-291-9/+17
|
* Fixed #28387 -- Fixed has_changed() for disabled form fields that subclass it.Srinivas Reddy Thatiparthy2017-07-141-0/+8
|
* Fixed #28345 -- Applied limit_choices_to during ModelForm.__init__().Jon Dufresne2017-06-301-1/+11
| | | | | | | | field_for_model() now has an additional keyword argument, apply_limit_choices_to, allowing it to continue to be used to create form fields dynamically after ModelForm.__init__() is called. Thanks Tim Graham for the review.
* Refs #23919 -- Replaced stray super(ClassName, self) with super().Tom2017-06-101-1/+1
|
* Fixed #28242 -- Moved ImageField file extension validation to the form field.Manatsawin Hanmongkolchai2017-06-011-1/+19
|
* Fixed #28249 -- Removed unnecessary dict.keys() calls.Jon Dufresne2017-05-271-9/+9
| | | iter(dict) is equivalent to iter(dict.keys()).
* Fixed #27993 -- Fixed model form default fallback for SelectMultiple.heathervm2017-03-311-0/+16
|
* Fixed #27975 -- Fixed crash if ModelChoiceField's queryset=None.James Beith2017-03-221-0/+11
| | | | Regression in 9153d8fbd6385db9f48793662de789fc3d686841.
* Fixed nondeterministic ordering test failure in model_forms.Mariusz Felisiak2017-03-161-1/+1
|
* Refs #27563 -- Fixed ModelChoiceField.__deepcopy__() so forms don't share a ↵Tim Graham2017-03-151-0/+9
| | | | | queryset cache. Thanks Luke Benstead for the report Simon Charettes for the fix.
* Removed obsolete references to form_for_instance().Tim Graham2017-02-281-2/+0
|
* Fixed #27758 -- Reallowed AdvancedModelIterator pattern after template ↵Jon Dufresne2017-01-311-0/+37
| | | | widget rendering.
* Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand2017-01-251-3/+3
|
* Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.Tim Graham2017-01-201-4/+3
| | | These functions do nothing on Python 3.
* Refs #23919 -- Removed str() conversion of type and method __name__.Simon Charette2017-01-191-6/+6
|
* Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette2017-01-191-1/+1
|
* Refs #23919 -- Removed most of remaining six usageClaude Paroz2017-01-181-2/+1
| | | | Thanks Tim Graham for the review.
* Refs #23919 -- Removed six.<various>_types usageClaude Paroz2017-01-181-17/+17
| | | | Thanks Tim Graham and Simon Charette for the reviews.
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-181-2/+0
|
* Refs #26154 -- Removed deprecated CommaSeparatedIntegerField.Tim Graham2017-01-171-35/+6
|
* Fixed #27370 -- Prevented Select widget from using 'required' with a ↵Josef Rousek2016-12-281-2/+2
| | | | non-empty first value.
* Fixed #15667 -- Added template-based widget rendering.Preston Timmons2016-12-271-8/+1
| | | | Thanks Carl Meyer and Tim Graham for contributing to the patch.
* Updated LimitChoicesToTests to use setUpTestData and cosmetic edits.Tim Graham2016-12-021-13/+12
|
* Fixed #27563 -- Moved "apply limit_choices_to" code from BaseModelForm to ↵Jon Dufresne2016-12-021-0/+4
| | | | fields_for_model().
* Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za2016-11-101-9/+8
|
* Fixed #27369 -- Prevented widgets from being shared between form field ↵Michal Petrucha2016-11-061-1/+1
| | | | instances.
* Refs #27186 -- Fixed model form default fallback for CheckboxSelectMultiple.Tim Graham2016-09-301-1/+17
|
* Fixed #27186 -- Fixed model form default fallback for MultiWidget, ↵Tim Graham2016-09-221-0/+52
| | | | | | FileInput, SplitDateTimeWidget, SelectDateWidget, and SplitArrayWidget. Thanks Matt Westcott for the review.
* Fixed #27256 -- Changed Select widget's selected attribute to use HTML5 ↵Jon Dufresne2016-09-211-22/+22
| | | | boolean syntax.
* Organized forms_tests test_regressions.py.Tim Graham2016-09-091-0/+16
|
* Refs #27039 -- Fixed regression with field defaults in prefixed forms.Alex Hill2016-09-011-0/+16
|
* Fixed #27039 -- Fixed empty data fallback to model field default in model forms.Tim Graham2016-08-241-2/+41
|
* Fixed #27002 -- Prevented double query when rendering ModelChoiceField.Alex Hill2016-08-081-3/+14
|
* Fixed #27001 -- Fixed a query count regression in ModelChoiceField with ↵Alex Hill2016-08-031-0/+8
| | | | RadioSelect.
* Fixed #26970 -- Fixed crash with disabled ModelMultipleChoiceField.Tim Graham2016-07-301-0/+25
|
* Fixed #26917 -- Fixed crash in disabled ModelChoiceFields.Tim Graham2016-07-271-0/+15
| | | | | | | | Partially reverted refs #25532 to fix a regression in Django 1.10. This reintroduces a crash for disabled forms.JSONField (refs #26949), however, that issue is also present on Django 1.9. Thanks Ryan Schave for the test.
* Fixed #17657 -- Made ModelForm respect ModelMultipleChoiceField's to_field_name.Andrey Fedoseev2016-07-121-72/+19
| | | | Follow up to 67d984413c9540074e4fe6aa033081a35cf192bc.