summaryrefslogtreecommitdiff
path: root/tests/model_forms
Commit message (Collapse)AuthorAgeFilesLines
* Used 4 space hanging indent for dictionaries.Tim Graham2019-01-021-9/+19
| | | Thanks Mariusz Felisiak for auditing.
* Followed style guide for model attribute ordering.Matt Wiens2018-12-271-3/+3
|
* Moved choices inside of test models per coding style.Manan2018-12-101-12/+10
|
* 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.
* Refs #28312 -- Added an optimized __bool__() to ModelChoiceIterator.François Freitag2018-04-231-0/+11
| | | | COUNT is more expensive than EXISTS; use the latter when possible.
* Fixed #28312 -- Made ModelChoiceIterator.__len__() more memory-efficient.François Freitag2018-04-232-12/+20
| | | | | | | | | 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 #29159 -- Made ModelChoiceIterator reuse QuerySet result cache.François Freitag2018-03-011-0/+11
| | | | | | | When __len__() is called (e.g. when casting to list or tuple), the QuerySet is evaluated and the result cache populated. iterator() shouldn't be called on the QuerySet after that, as it would reset the result cache and trigger a second query.
* Fixed #29158 -- Fixed len(choices) crash if ModelChoiceField's queryset is a ↵François Freitag2018-03-012-1/+2
| | | | | | | 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-012-258/+277
|
* Eliminated the need to modify a model forms test when new test files are added.Tim Graham2018-02-282-7/+3
|
* 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-012-1/+30
|
* 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-282-10/+0
|
* Refs #23919 -- Used yield from.Vytis Banaitis2017-02-231-2/+1
|
* 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-252-9/+9
|
* Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.Tim Graham2017-01-202-6/+4
| | | 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-182-3/+1
| | | | Thanks Tim Graham for the review.
* Refs #23919 -- Removed six.<various>_types usageClaude Paroz2017-01-182-19/+18
| | | | Thanks Tim Graham and Simon Charette for the reviews.
* Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz2017-01-181-17/+0
|
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-183-6/+0
|
* Refs #26154 -- Removed deprecated CommaSeparatedIntegerField.Tim Graham2017-01-172-43/+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.
* Fixed #27148 -- Fixed ModelMultipleChoiceField crash with invalid UUID.Tim Graham2016-10-311-0/+6
|
* 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-222-0/+54
| | | | | | 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.
* Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.Tim Graham2016-09-171-1/+1
| | | | http://bugs.python.org/issue27364