summaryrefslogtreecommitdiff
path: root/tests/model_forms
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #34380 -- Allowed specifying a default URL scheme in forms.URLField.Coen van der Kamp2023-04-281-6/+33
| | | | This also deprecates "http" as the default scheme.
* Avoided creating default form fields in fields_for_model() when declared on ↵Mariusz Felisiak2023-04-271-0/+9
| | | | form.
* Fixed #31721 -- Allowed ModelForm meta to specify form fields.Kamil Turek2022-08-081-0/+35
|
* Fixed warnings per flake8 5.0.0.Mariusz Felisiak2022-07-311-42/+46
|
* Refs #32339 -- Deprecated default.html form template.David Smith2022-05-171-58/+59
| | | | Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
* Fixed various tests on MySQL with MyISAM storage engine.Mariusz Felisiak2022-04-181-0/+3
|
* Relaxed some query ordering assertions in various tests.Mariusz Felisiak2022-04-142-10/+10
| | | It accounts for differences seen on MySQL with MyISAM storage engine.
* Fixed #33627 -- Improved nonexistent pk in ↵SanderBeekhuis2022-04-131-1/+1
| | | | ModelMultipleChoiceFieldTests.test_model_multiple_choice_field().
* Removed redundant QuerySet.all() calls in docs and tests.Nick Pope2022-02-221-1/+1
| | | | Most QuerySet methods are mapped onto the Manager and, in general, it isn't necessary to call .all() on the manager.
* Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak2022-02-072-151/+260
|
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-074-937/+1407
|
* Stopped including type="text/css" attributes for CSS link tags.Claude Paroz2022-01-221-2/+2
|
* Refs #32338 -- Added Boundfield.legend_tag().David Smith2021-12-091-0/+12
|
* Fixed #33155 -- Made ModelChoiceIteratorValue instances hashable.Aljaž Košir2021-09-301-1/+7
|
* Fixed #33084 -- Removed incorrect system check for ManyToManyField with ↵Hasan Ramezani2021-09-092-2/+32
| | | | limit_choices_to.
* Refs #32338 -- Made RadioSelect/CheckboxSelectMultiple render in <div> tags.David Smith2021-08-271-13/+13
| | | | This improves accessibility for screen reader users.
* Fixed #31235 -- Made assertQuerysetEqual() compare querysets directly.Hasan Ramezani2020-11-061-20/+20
| | | | | | | | 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>
* Fixed #1891, Fixed #11707 -- Prevented duplicates with limit_choices_to on ↵alvinshaita2020-10-272-2/+74
| | | | multi-value relations.
* Refs #28009 -- Added empty_value tests for CharField subclasses.David Smith2020-09-252-4/+18
|
* Bumped minimum isort version to 5.1.0.David Smith2020-07-301-1/+1
| | | | | Fixed inner imports per isort 5. isort 5.0.0 to 5.1.0 was unstable.
* Fixed test_clean_does_deduplicate_values on Oracle after ↵Mariusz Felisiak2020-06-261-4/+4
| | | | e13cfc6dfd4212ef7a40db1a41d3ae6ac4b97de0.
* Fixed #31596 -- Changed ForeignKey.validate() to use the base manager.Jon Dufresne2020-06-252-0/+55
|
* Used assertIs(…, True) in model_forms.tests.ValidationTest.Jon Dufresne2020-05-181-3/+3
|
* Changed django.forms.ValidationError imports to ↵François Freitag2020-04-282-4/+3
| | | | | | django.core.exceptions.ValidationError. Co-Authored-By: Mariusz Felisiak <felisiak.mariusz@gmail.com>
* Fixed #26813 -- Prevented empty choice in ModelChoiceField with RadioSelect ↵Hasan Ramezani2020-02-053-0/+40
| | | | for fields with blank=False.
* Refs #26813 -- Added test for ModelChoiceField.choices when using ↵Mariusz Felisiak2020-02-051-0/+14
| | | | RadioSelect widget.
* Fixed #30998 -- Added ModelChoiceIteratorValue to pass the model instance to ↵Jon Dufresne2019-12-231-0/+26
| | | | ChoiceWidget.create_option().
* Fixed typo in ModelChoiceFieldTests.Jon Dufresne2019-12-111-1/+1
| | | | The subindex and attrs arguments should be passed through to the parent, not overridden as None.
* Fixed #31080 -- Removed redundant type="text/javascript" attribute from ↵Jon Dufresne2019-12-111-1/+1
| | | | <script> tags.
* Fixed #30014 -- Fixed ModelChoiceField validation when initial value is a ↵Etienne Chové2019-10-111-0/+19
| | | | | | model instance. Thanks Carlton Gibson for reviews.
* Added ModelChoiceField test for validation with to_field_name.Etienne Chové2019-10-111-0/+4
|
* Fixed #30400 -- Improved typography of user facing strings.Jon Dufresne2019-06-282-2/+2
| | | | Thanks Claude Paroz for assistance with translations.
* Fixed #30534 -- Fixed overriding a field's default in ModelForm.cleaned_data().RobertAKARobin2019-06-041-0/+26
|
* Fixed #30399 -- Changed django.utils.html.escape()/urlize() to use ↵Jon Dufresne2019-04-251-7/+7
| | | | html.escape()/unescape().
* Fixed #30302 -- Fixed forms.model_to_dict() result if empty list of fields ↵belegnar2019-04-031-0/+1
| | | | is passed.
* Refs #30302 -- Added more tests for forms.model_to_dict().belegnar2019-04-031-0/+3
|
* 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
|