summaryrefslogtreecommitdiff
path: root/tests/model_forms
AgeCommit message (Collapse)Author
2024-06-17[5.1.x] Fixed #35483 -- Added NUL (0x00) character validation to ↵Alexander Lötvall
ModelChoiceFields. Applied the ProhibitNullCharactersValidator to ModelChoiceField and ModelMultipleChoiceField. Co-authored-by: Viktor Paripás <viktor.paripas@gmail.com> Co-authored-by: Vasyl Dizhak <vasyl@dizhak.com> Co-authored-by: Arthur Vasconcelos <vasconcelos.arthur@gmail.com> Backport of 38ad710aba885ad26944ff5708ce1a02a446d2d3 from main.
2024-01-02Fixed #35060 -- Deprecated passing positional arguments to Model.save()/asave().Salvo Polizzi
2023-11-28Refs #34380 -- Added FORMS_URLFIELD_ASSUME_HTTPS transitional setting.Mariusz Felisiak
This allows early adoption of the new default "https".
2023-11-28Refs #34986 -- Fixed some test assertions for PyPy.Nick Pope
These failures were due to minor inconsistencies or implementation differences between CPython and PyPy.
2023-10-23Fixed #34899 -- Added blank choice to forms' callable choices lazily.Nick Pope
2023-07-06Fixed #32819 -- Established relationship between form fields and their help ↵Gregor Jerše
text. Thanks Nimra for the initial patch. Thanks Natalia Bidart, Thibaud Colas, David Smith, and Mariusz Felisiak for reviews.
2023-04-28Fixed #34380 -- Allowed specifying a default URL scheme in forms.URLField.Coen van der Kamp
This also deprecates "http" as the default scheme.
2023-04-27Avoided creating default form fields in fields_for_model() when declared on ↵Mariusz Felisiak
form.
2022-08-08Fixed #31721 -- Allowed ModelForm meta to specify form fields.Kamil Turek
2022-07-31Fixed warnings per flake8 5.0.0.Mariusz Felisiak
2022-05-17Refs #32339 -- Deprecated default.html form template.David Smith
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2022-04-18Fixed various tests on MySQL with MyISAM storage engine.Mariusz Felisiak
2022-04-14Relaxed some query ordering assertions in various tests.Mariusz Felisiak
It accounts for differences seen on MySQL with MyISAM storage engine.
2022-04-13Fixed #33627 -- Improved nonexistent pk in ↵SanderBeekhuis
ModelMultipleChoiceFieldTests.test_model_multiple_choice_field().
2022-02-22Removed redundant QuerySet.all() calls in docs and tests.Nick Pope
Most QuerySet methods are mapped onto the Manager and, in general, it isn't necessary to call .all() on the manager.
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2022-01-22Stopped including type="text/css" attributes for CSS link tags.Claude Paroz
2021-12-09Refs #32338 -- Added Boundfield.legend_tag().David Smith
2021-09-30Fixed #33155 -- Made ModelChoiceIteratorValue instances hashable.Aljaž Košir
2021-09-09Fixed #33084 -- Removed incorrect system check for ManyToManyField with ↵Hasan Ramezani
limit_choices_to.
2021-08-27Refs #32338 -- Made RadioSelect/CheckboxSelectMultiple render in <div> tags.David Smith
This improves accessibility for screen reader users.
2020-11-06Fixed #31235 -- Made assertQuerysetEqual() compare querysets directly.Hasan Ramezani
This also replaces assertQuerysetEqual() to assertSequenceEqual()/assertCountEqual() where appropriate. Co-authored-by: Peter Inglesby <peter.inglesby@gmail.com> Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2020-10-27Fixed #1891, Fixed #11707 -- Prevented duplicates with limit_choices_to on ↵alvinshaita
multi-value relations.
2020-09-25Refs #28009 -- Added empty_value tests for CharField subclasses.David Smith
2020-07-30Bumped minimum isort version to 5.1.0.David Smith
Fixed inner imports per isort 5. isort 5.0.0 to 5.1.0 was unstable.
2020-06-26Fixed test_clean_does_deduplicate_values on Oracle after ↵Mariusz Felisiak
e13cfc6dfd4212ef7a40db1a41d3ae6ac4b97de0.
2020-06-25Fixed #31596 -- Changed ForeignKey.validate() to use the base manager.Jon Dufresne
2020-05-18Used assertIs(…, True) in model_forms.tests.ValidationTest.Jon Dufresne
2020-04-28Changed django.forms.ValidationError imports to ↵François Freitag
django.core.exceptions.ValidationError. Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2020-02-05Fixed #26813 -- Prevented empty choice in ModelChoiceField with RadioSelect ↵Hasan Ramezani
for fields with blank=False.
2020-02-05Refs #26813 -- Added test for ModelChoiceField.choices when using ↵Mariusz Felisiak
RadioSelect widget.
2019-12-23Fixed #30998 -- Added ModelChoiceIteratorValue to pass the model instance to ↵Jon Dufresne
ChoiceWidget.create_option().
2019-12-11Fixed typo in ModelChoiceFieldTests.Jon Dufresne
The subindex and attrs arguments should be passed through to the parent, not overridden as None.
2019-12-11Fixed #31080 -- Removed redundant type="text/javascript" attribute from ↵Jon Dufresne
<script> tags.
2019-10-11Fixed #30014 -- Fixed ModelChoiceField validation when initial value is a ↵Etienne Chové
model instance. Thanks Carlton Gibson for reviews.
2019-10-11Added ModelChoiceField test for validation with to_field_name.Etienne Chové
2019-06-28Fixed #30400 -- Improved typography of user facing strings.Jon Dufresne
Thanks Claude Paroz for assistance with translations.
2019-06-04Fixed #30534 -- Fixed overriding a field's default in ModelForm.cleaned_data().RobertAKARobin
2019-04-25Fixed #30399 -- Changed django.utils.html.escape()/urlize() to use ↵Jon Dufresne
html.escape()/unescape().
2019-04-03Fixed #30302 -- Fixed forms.model_to_dict() result if empty list of fields ↵belegnar
is passed.
2019-04-03Refs #30302 -- Added more tests for forms.model_to_dict().belegnar
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.