summaryrefslogtreecommitdiff
path: root/tests/model_forms
AgeCommit message (Collapse)Author
2019-01-02Used 4 space hanging indent for dictionaries.Tim Graham
Thanks Mariusz Felisiak for auditing.
2018-12-27Followed style guide for model attribute ordering.Matt Wiens
2018-12-10Moved choices inside of test models per coding style.Manan
2018-11-27Switched setUp() to setUpTestData() where possible in Django's tests.Simon Charette
2018-11-27Switched TestCase to SimpleTestCase where possible in Django's tests.Tim Graham
2018-07-25Refs #13091 -- Added test for commit=False idiom with partial ↵Carlton Gibson
unique_together validation.
2018-04-23Refs #28312 -- Added an optimized __bool__() to ModelChoiceIterator.François Freitag
COUNT is more expensive than EXISTS; use the latter when possible.
2018-04-23Fixed #28312 -- Made ModelChoiceIterator.__len__() more memory-efficient.François Freitag
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.
2018-03-31Fixed #29279 -- Added renderer argument to ModelForm.Dan Watson
2018-03-16Fixed hanging indentation in various code.Mariusz Felisiak
2018-03-01Fixed #29159 -- Made ModelChoiceIterator reuse QuerySet result cache.François Freitag
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.
2018-03-01Fixed #29158 -- Fixed len(choices) crash if ModelChoiceField's queryset is a ↵François Freitag
manager. Removing all() in __iter__() prevents a duplicate query when choices are cast to a list and there's a prefetch_related().
2018-03-01Consolidated ModelChoiceField tests.François Freitag
2018-02-28Eliminated the need to modify a model forms test when new test files are added.Tim Graham
2018-01-21Fixed #29038 -- Removed closing slash from HTML void tags.Jon Dufresne
2018-01-20Fixed #29041 -- Changed SelectMultiple's multiple attribute to HTML5 boolean ↵Jon Dufresne
syntax.
2017-08-31Fixed #28543 -- Prevented ManyToManyField.value_from_object() from being lazy.Tim Graham
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.
2017-07-29Used assertRaisesMessage() to test Django's error messages.Mads Jensen
2017-07-14Fixed #28387 -- Fixed has_changed() for disabled form fields that subclass it.Srinivas Reddy Thatiparthy
2017-06-30Fixed #28345 -- Applied limit_choices_to during ModelForm.__init__().Jon Dufresne
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.
2017-06-10Refs #23919 -- Replaced stray super(ClassName, self) with super().Tom
2017-06-01Fixed #28242 -- Moved ImageField file extension validation to the form field.Manatsawin Hanmongkolchai
2017-05-27Fixed #28249 -- Removed unnecessary dict.keys() calls.Jon Dufresne
iter(dict) is equivalent to iter(dict.keys()).
2017-03-31Fixed #27993 -- Fixed model form default fallback for SelectMultiple.heathervm
2017-03-22Fixed #27975 -- Fixed crash if ModelChoiceField's queryset=None.James Beith
Regression in 9153d8fbd6385db9f48793662de789fc3d686841.
2017-03-16Fixed nondeterministic ordering test failure in model_forms.Mariusz Felisiak
2017-03-15Refs #27563 -- Fixed ModelChoiceField.__deepcopy__() so forms don't share a ↵Tim Graham
queryset cache. Thanks Luke Benstead for the report Simon Charettes for the fix.
2017-02-28Removed obsolete references to form_for_instance().Tim Graham
2017-02-23Refs #23919 -- Used yield from.Vytis Banaitis
2017-01-31Fixed #27758 -- Reallowed AdvancedModelIterator pattern after template ↵Jon Dufresne
widget rendering.
2017-01-25Refs #23919 -- Replaced super(ClassName, self) with super().chillaranand
2017-01-20Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.Tim Graham
These functions do nothing on Python 3.
2017-01-19Refs #23919 -- Removed str() conversion of type and method __name__.Simon Charette
2017-01-19Refs #23919 -- Stopped inheriting from object to define new style classes.Simon Charette
2017-01-18Refs #23919 -- Removed most of remaining six usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed six.<various>_types usageClaude Paroz
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-18Refs #23919 -- Removed python_2_unicode_compatible decorator usageClaude Paroz
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2017-01-17Refs #26154 -- Removed deprecated CommaSeparatedIntegerField.Tim Graham
2016-12-28Fixed #27370 -- Prevented Select widget from using 'required' with a ↵Josef Rousek
non-empty first value.
2016-12-27Fixed #15667 -- Added template-based widget rendering.Preston Timmons
Thanks Carl Meyer and Tim Graham for contributing to the patch.
2016-12-02Updated LimitChoicesToTests to use setUpTestData and cosmetic edits.Tim Graham
2016-12-02Fixed #27563 -- Moved "apply limit_choices_to" code from BaseModelForm to ↵Jon Dufresne
fields_for_model().
2016-11-10Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za
2016-11-06Fixed #27369 -- Prevented widgets from being shared between form field ↵Michal Petrucha
instances.
2016-10-31Fixed #27148 -- Fixed ModelMultipleChoiceField crash with invalid UUID.Tim Graham
2016-09-30Refs #27186 -- Fixed model form default fallback for CheckboxSelectMultiple.Tim Graham
2016-09-22Fixed #27186 -- Fixed model form default fallback for MultiWidget, ↵Tim Graham
FileInput, SplitDateTimeWidget, SelectDateWidget, and SplitArrayWidget. Thanks Matt Westcott for the review.
2016-09-21Fixed #27256 -- Changed Select widget's selected attribute to use HTML5 ↵Jon Dufresne
boolean syntax.
2016-09-17Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.Tim Graham
http://bugs.python.org/issue27364