Commit Graph

402 Commits

Author SHA1 Message Date
Herbert Parentes Fortes Neto d368784bac Fixed #28171 -- Added an exception if Form's empty_permitted and use_required_attribute arguments conflict. 2018-02-15 13:44:26 -05:00
Tim Graham d0a42a14c0 Fixed imports per isort 4.3.1.
Partially reverted 9bcf73d788.
2018-02-02 14:44:07 -05:00
Mariusz Felisiak 9bcf73d788 Fixed imports per isort 4.3.0. 2018-02-01 09:29:46 +01:00
Vlastimil Zíma fbc3c29e7c Fixed #29036 -- Fixed HTML5 required validation on SelectDateWidget if the attribute is added by JavaScript.
Thanks Tim Graham for the initial patch.
2018-01-30 19:09:31 -05:00
Tim Graham 3a4b11873a
Added tests for SelectDateWidget.value_from_datadict(). 2018-01-30 18:10:33 -05:00
Jon Dufresne ff05de760c Fixed #29038 -- Removed closing slash from HTML void tags. 2018-01-21 02:09:10 -05:00
Jon Dufresne 47d238b696 Fixed #29041 -- Changed SelectMultiple's multiple attribute to HTML5 boolean syntax. 2018-01-20 11:19:06 -05:00
Tim Graham 4bcec02368 Added tests for django.forms.formsets.all_valid(). 2018-01-12 12:40:21 -05:00
Fabio Bonelli c886f3dee3 Fixed #29006 -- Fixed DecimalField.clean() crash on sNaN values. 2018-01-10 20:30:44 -05:00
Tim Graham 1c95737ebe Reduced redundancy in DecimalField tests with subTest(). 2018-01-10 20:30:24 -05:00
Tim Graham ec2ce4517a Fixed #28882 -- Fixed cleaning of disabled MultiValueFields.
Thanks avalanchy for the initial patch.
2018-01-05 15:49:54 -05:00
Daniil 7c7bc6391a Fixed #28874 -- Prevented double escaping of errors on hidden form fields. 2017-12-11 07:30:47 -05:00
Nick Pope e014f91a70 Fixed #28890 -- Removed newlines between MultiWidget's subwidgets.
Regression in b52c73008a.
2017-12-05 11:22:36 -05:00
Srinivas Reddy Thatiparthy 55b5393bd2 Fixed #28474 -- Made DurationField raise ValidationError for inputs that raised OverflowError. 2017-10-25 18:05:13 -04:00
Josh Schneier e8c4596329 Fixed #28562 -- Fixed DecimalValidator handling of positive exponent scientific notation. 2017-09-27 09:42:04 -04:00
Tim Graham 2bd207ada0 Refs #15667 -- Removed support for Widget.render() methods without the renderer argument.
Per deprecation timeline.
2017-09-22 12:51:18 -04:00
Josh Schneier 48c394a6fc Fixed #28555 -- Made CharField convert whitespace-only values to the empty_value when strip is enabled. 2017-09-05 12:41:38 -04:00
caleb logan 9e2bf65d6a Fixed #28530 -- Prevented SelectDateWidget from localizing years in output. 2017-08-29 14:56:08 -04:00
Collin Anderson 751f7a6d9b Added Media.__repr__().
It makes it easier to debug MediaOrderConflictWarnings
(refs #28377).
2017-08-26 20:57:45 -04:00
Alejandro Zamora 90d7b912b9 Fixed #28201 -- Added ProhibitNullCharactersValidator and used it on CharField form field. 2017-08-12 20:14:14 -04:00
Tim Graham d04b324969 Fixed #28421 -- Split some long FormSet tests and made other cosmetic cleanups.
Thanks Windson for the initial patch.
2017-08-11 17:43:50 -04:00
Mads Jensen a51c4de194 Used assertRaisesMessage() to test Django's error messages. 2017-07-29 19:07:23 -04:00
Srinivas Reddy Thatiparthy b306c0c1a3 Fixed #28264 -- Made FilePathField sort files and directories when recursive=True. 2017-07-29 09:15:46 -04:00
Windson yang f32d24652b Fixed #28321 -- Prevented FormSet.full_clean() from adding errors from deleted forms. 2017-07-24 18:55:41 -04:00
Johannes Hoppe c19b56f633 Fixed #28377 -- Made combining form Media retain relative asset order.
Thanks Florian Apolloner, Mariusz Felisiak, and Tim Graham for reviews.
2017-07-20 11:06:30 -04:00
Roman Selivanov d4da39685b Fixed #28414 -- Fixed ClearableFileInput rendering as a subwidget of MultiWidget. 2017-07-19 14:28:06 -04:00
Srinivas Reddy Thatiparthy 71ff9a74cb Created a dedicated test directory for FilePathField tests. 2017-07-17 16:40:34 -04:00
Srinivas Reddy Thatiparthy 5debbdfcc8 Fixed #28387 -- Fixed has_changed() for disabled form fields that subclass it. 2017-07-14 13:06:51 -04:00
Tim Graham 221e6e1817 Fixed #28176 -- Restored the uncasted option value in ChoiceWidget template context. 2017-06-17 18:17:23 -04:00
Tim Graham 3b050fd0d0 Fixed #28303 -- Prevented localization of attribute values in the DTL attrs.html widget template. 2017-06-17 08:12:05 -04:00
Claude Paroz 43b574007e Fixed #28192 -- Required passing optional form field args as keyword args. 2017-06-03 10:49:01 -04:00
Claude Paroz 54caca2d34 Refs #28192 -- Fixed documentation of ChoiceField choices requirement
Thanks Tim Graham for noticing the issue.
2017-06-03 16:17:03 +02:00
Jon Dufresne 29a518006f Fixed #28265 -- Prevented renderer warning on Widget.render() with **kwargs. 2017-06-02 09:46:43 -04:00
Jon Dufresne 2c69824e5a Refs #23968 -- Removed unnecessary lists, generators, and tuple calls. 2017-06-01 19:08:59 -04:00
Manatsawin Hanmongkolchai a0c07d77fc Fixed #28242 -- Moved ImageField file extension validation to the form field. 2017-06-01 10:13:23 -04:00
Tim Graham 84fb50df67 Fixed a forms test after updated translations. 2017-05-31 19:29:34 -04:00
Jon Dufresne 21046e7773 Fixed #28249 -- Removed unnecessary dict.keys() calls.
iter(dict) is equivalent to iter(dict.keys()).
2017-05-27 19:08:46 -04:00
Tim Heap 5b6181f4d5 Fixed #27922 -- Added ErrorDict.get_json_data(). 2017-05-27 09:19:42 -04:00
Bruno Alla 6092ea8fa6 Refs #27804 -- Used subTest() in several tests. 2017-05-24 08:36:34 -04:00
Tim Graham d302e2c09c Fixed #28157 -- Fixed choice ordering in form fields with grouped and non-grouped options.
Regression in b52c73008a.
2017-05-03 07:21:44 -04:00
Tim Graham f04a404917 Fixed #28130 -- Fixed formset min_num validation with initial, unchanged forms.
Regression in f5c6295797.
2017-04-28 09:32:40 -04:00
Tim Graham 851874fe0a Removed obsolete Widget.format_output() in tests.
Obsolete since b52c73008a.
2017-04-24 13:41:34 -04:00
Jon Dufresne 581879a510 Fixed #28075 -- Prevented ChoiceWidget from localizing option values. 2017-04-21 12:14:40 -04:00
Tim Graham af1f986360 Fixed #28059 -- Restored class attribute in <ul> of widgets that use multiple_input.html.
Regression in b52c73008a
2017-04-20 10:06:34 -04:00
Tim Graham c09bf8d767 Fixed #28058 -- Restored empty BoundFields evaluating to True.
Regression in b52c73008a
2017-04-17 08:32:29 -04:00
Raphael Michel bde814142a Fixed #22654 -- Broken decimal validation 2017-04-07 12:45:08 +02:00
Stefan Wehrmeyer 1aa8e8605c Fixed #27989 -- Preserved empty QueryDicts for form's data/files args. 2017-04-01 18:43:39 -04:00
Claude Paroz e487ffd3f0 Fixed #27866 -- Made ChoiceWidget.format_value() return a list
Thanks Tim Graham for the review.
2017-04-01 12:24:05 +02:00
heathervm 7d1e237753 Fixed #27993 -- Fixed model form default fallback for SelectMultiple. 2017-03-31 10:10:08 -04:00
Jon Dufresne 7edeeb74fe Fixed #27957 -- Removed technical terms from InlineForeignKeyField/ModelMultipleChoiceField error messages. 2017-03-20 13:12:55 -04:00
Adonys Alea Boffill cd2ad26cc9 Fixed #27724 -- Fixed SelectDateWidget redisplay if a year isn't chosen. 2017-03-18 15:14:52 -04:00
Adonys Alea Boffill fb48ad348a Added tests for SelectDateWidget.format_value(). 2017-03-18 14:58:31 -04:00
Tim Graham 6b4f018b2b Replaced type-specific assertions with assertEqual().
Python docs say, "it's usually not necessary to invoke these methods directly."
2017-03-17 07:51:48 -04:00
Claude Paroz 540ae68a5c Fixed #27920 -- Restored empty RadioSelect choice producing value=""
Regression in b52c73008a.
Thanks Tim Graham for the review.
2017-03-14 18:23:06 +01:00
Tim Graham 75f0070a54 Fixed #27308 -- Fixed BytesWarnings in the test suite. 2017-02-17 16:04:45 -05:00
Tim Graham 500532c95d Refs #23919 -- Removed default 'utf-8' argument for str.encode()/decode(). 2017-02-09 09:03:47 -05:00
Mariusz Felisiak 0034e9af18 Fixed #5851 -- Allowed specifying different HTML attrs for SplitDateTimeWidget subwidgets.
Thanks Tim Graham and Nick Pope for review.
2017-02-07 11:33:37 -05:00
Claude Paroz c651331b34 Converted usage of ugettext* functions to their gettext* aliases
Thanks Tim Graham for the review.
2017-02-07 09:04:04 +01:00
Tim Graham 4353640ea9 Fixed #27805 -- Fixed ClearableFileInput's "Clear" checkbox on model fields with a default. 2017-02-06 20:31:04 -05:00
Vytis Banaitis 8838d4dd49 Refs #23919 -- Replaced kwargs.pop() with keyword-only arguments. 2017-02-01 11:41:56 -05:00
Vytis Banaitis d1bab24e01 Refs #23919, #27778 -- Removed obsolete mentions of unicode. 2017-01-26 08:19:27 -05:00
chillaranand d6eaf7c018 Refs #23919 -- Replaced super(ClassName, self) with super(). 2017-01-25 12:23:46 -05:00
Claude Paroz 2366100872 Removed unneeded force_text calls in the test suite 2017-01-24 18:45:54 +01:00
Jon Dufresne 5fa390ee81 Fixed #27759 -- Prevented forms attrs.html template from rendering False attrs.
Regression in b52c73008a.
2017-01-23 08:49:00 -05:00
Jon Dufresne 88183117c2 Fixed #27761 -- Fixed quote location in multiple_input.html forms templates. 2017-01-23 07:44:57 -05:00
Tim Graham d170c63351 Refs #23919 -- Removed misc references to Python 2. 2017-01-21 20:02:00 -05:00
Claude Paroz 289fc1bfa5 Refs #23919 -- Removed str_prefix usage 2017-01-20 15:43:28 +01:00
Tim Graham 7aba69145d Refs #23919 -- Removed django.test.mock Python 2 compatibility shim. 2017-01-20 08:17:20 -05:00
Claude Paroz 042b7350a0 Refs #23919 -- Removed unneeded str() calls 2017-01-20 14:13:55 +01:00
Tim Graham 4e729feaa6 Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.
These functions do nothing on Python 3.
2017-01-20 08:01:02 -05:00
Tim Graham 109b33f64c Refs #23919 -- Simplified assertRaisesRegex()'s that accounted for Python 2. 2017-01-20 08:49:47 +01:00
Simon Charette cecc079168 Refs #23919 -- Stopped inheriting from object to define new style classes. 2017-01-19 08:39:46 +01:00
Claude Paroz 7b2f2e74ad Refs #23919 -- Removed six.<various>_types usage
Thanks Tim Graham and Simon Charette for the reviews.
2017-01-18 20:18:46 +01:00
Claude Paroz f3c43ad1fd Refs #23919 -- Removed python_2_unicode_compatible decorator usage 2017-01-18 13:44:34 +01:00
Claude Paroz d7b9aaa366 Refs #23919 -- Removed encoding preambles and future imports 2017-01-18 09:55:19 +01:00
Tim Graham 742d666da5 Refs #24219 -- Removed django.forms.extras per deprecation timeline. 2017-01-17 14:09:28 -05:00
Mariusz Felisiak 974d14534c Fixed #27723 -- Set MultiWidget's subwidgets input type from attrs argument.
Regression in b52c73008a.
2017-01-13 06:34:33 -05:00
Mariusz Felisiak 6872ce2266 Fixed #27712 -- Reallowed Input widget's attrs argument to set the input type.
Regression in b52c73008a.
2017-01-10 11:38:27 -05:00
Dmitry 12cefee5d8 Refs #15667 -- Prevented newlines in attrs.html widget rendering.
Removed the trailing newline from widget attrs.html template.
The solution may be revisited by fixing refs #9198 but not
for Django 1.11.

Thanks Dmitry Ivanchenko for the report and Preston Timmons for advice.
2017-01-06 19:11:32 -05:00
Tim Graham 4e89082f31 Refs #15667 -- Fixed form renderer test for Python 2 non-ASCII path. 2016-12-28 15:57:55 -05:00
Josef Rousek aaecf038ca Fixed #27370 -- Prevented Select widget from using 'required' with a non-empty first value. 2016-12-28 10:45:22 -05:00
Preston Timmons b52c73008a Fixed #15667 -- Added template-based widget rendering.
Thanks Carl Meyer and Tim Graham for contributing to the patch.
2016-12-27 17:50:10 -05:00
Illia Volochii 4a51ba228b Fixed #27642 -- Made forms.utils.flatatt() omit 'None' values from attrs. 2016-12-27 09:42:17 -05:00
Tim Graham b5f0b3478d Fixed #27579 -- Added aliases for Python 3's assertion names in SimpleTestCase. 2016-12-07 17:42:31 -05:00
Claude Paroz d49551bc26 Fixed #27119 -- Cached BaseFormSet.management_form property
Thanks Tim Graham for the review.
2016-12-01 20:17:25 +01:00
Diego Martín abd434059e Fixed #27250 -- Removed 'for ="..."' from CheckboxSelectMultiple's <label>. 2016-11-22 11:48:37 -05:00
Ramin Farajpour Cami 967be82443 Fixed E305 flake8 warnings. 2016-11-14 12:30:46 -05:00
Kenneth Veldman 8618a7eaa1 Fixed #27431 -- Prevented disabled form fields from appearing as changed. 2016-11-11 06:57:57 -05:00
za 321e94fa41 Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings. 2016-11-10 21:30:21 -05:00
Michal Petrucha 09da1e79de Fixed #27369 -- Prevented widgets from being shared between form field instances. 2016-11-06 07:16:56 +01:00
Tim Graham 87c5e7efeb Refs #27186 -- Fixed model form default fallback for CheckboxSelectMultiple. 2016-09-30 14:49:50 -04:00
Tim Graham 3507d4e773 Fixed #27186 -- Fixed model form default fallback for MultiWidget, FileInput, SplitDateTimeWidget, SelectDateWidget, and SplitArrayWidget.
Thanks Matt Westcott for the review.
2016-09-22 12:20:58 -04:00
Jon Dufresne 2c716c1dc7 Fixed #27256 -- Changed Select widget's selected attribute to use HTML5 boolean syntax. 2016-09-21 15:12:13 -07:00
Tim Graham 8119b679eb Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.
http://bugs.python.org/issue27364
2016-09-17 15:44:06 -04:00
Tim Graham dab653cadc Organized forms_tests test_regressions.py. 2016-09-09 08:55:29 -04:00
Jon Dufresne f5c6d3c8d9 Fixed #27068 -- Unified form field initial data retrieval. 2016-08-18 17:55:47 -07:00
Jon Dufresne fab46ce6f5 Fixed #27037 -- Prevented required attribute on ClearableFileInput when initial data exists. 2016-08-12 13:59:01 -04:00
Tim Graham 176f27049e Updated an import per isort. 2016-08-10 15:27:31 -04:00
Andrew Nester f5c6295797 Fixed #26844 -- Made formset's validate_min validation ignore empty forms. 2016-08-10 13:03:04 -04:00
Marcin Nowak 74bb013cc1 Fixed #26905 -- Allowed using MultiValueDict-like objects as form data. 2016-08-09 19:46:24 -04:00