summaryrefslogtreecommitdiff
path: root/tests/validators
Commit message (Collapse)AuthorAgeFilesLines
* Fixed #34014 -- Fixed DecimalValidator validating 0 in positive exponent ↵Kamil Turek2022-09-171-0/+1
| | | | | | scientific notation. Thanks Shiplu Mokaddim for the report.
* Fixed #32559 -- Added 'step_size’ to numeric form fields.Kapil Bansal2022-05-121-0/+18
| | | | Co-authored-by: Jacob Rief <jacob.rief@uibk.ac.at>
* Refs #33476 -- Reformatted code with Black.django-bot2022-02-071-515/+568
|
* Refs #33476 -- Refactored problematic code before reformatting by Black.Mariusz Felisiak2022-02-031-2/+1
| | | | | | | | | | | | | | | | | In these cases Black produces unexpected results, e.g. def make_random_password( self, length=10, allowed_chars='abcdefghjkmnpqrstuvwxyz' 'ABCDEFGHJKLMNPQRSTUVWXYZ' '23456789', ): or cursor.execute(""" SELECT ... """, [table name], )
* Refs #31670 -- Removed whitelist argument and domain_whitelist attribute in ↵Mariusz Felisiak2021-09-201-41/+1
| | | | EmailValidator per deprecation timeline.
* Refs #22123 -- Added more URLValidator test for invalid IPv6 literals.Mariusz Felisiak2021-08-061-0/+3
|
* Fixed #32959 -- Moved tests URLs to validators.tests.chrishna12021-07-283-205/+225
|
* Fixed #32930 -- Fixed URLValidator when port numbers < 10.Wu Haotian2021-07-222-0/+5
|
* Added more test cases with port numbers for URLValidator.Wu Haotian2021-07-222-0/+10
|
* Fixed CVE-2021-33571 -- Prevented leading zeros in IPv4 addresses.Mariusz Felisiak2021-06-023-0/+34
| | | | | | | | validate_ipv4_address() was affected only on Python < 3.9.5, see [1]. URLValidator() uses a regular expressions and it was affected on all Python versions. [1] https://bugs.python.org/issue36384
* Fixed #32713, Fixed CVE-2021-32052 -- Prevented newlines and tabs from being ↵Mariusz Felisiak2021-05-061-1/+7
| | | | | | | | | | | | | | accepted in URLValidator on Python 3.9.5+. In Python 3.9.5+ urllib.parse() automatically removes ASCII newlines and tabs from URLs [1, 2]. Unfortunately it created an issue in the URLValidator. URLValidator uses urllib.urlsplit() and urllib.urlunsplit() for creating a URL variant with Punycode which no longer contains newlines and tabs in Python 3.9.5+. As a consequence, the regular expression matched the URL (without unsafe characters) and the source value (with unsafe characters) was considered valid. [1] https://bugs.python.org/issue43882 and [2] https://github.com/python/cpython/commit/76cd81d60310d65d01f9d7b48a8985d8ab89c8b4
* Fixed #32298 -- Fixed URLValidator hostname length validation.Akshat1Nar2021-01-041-0/+4
| | | | | URLValidator now validates the maximum length of a hostname without the userinfo and port.
* Fixed typo in DecimalValidator tests.Claudio Catterina2020-07-161-1/+1
| | | This replaces redundant test for -Infinity with +Infinity.
* Refs #31670 -- Renamed whitelist argument and attribute of EmailValidator.David Smith2020-06-181-2/+42
|
* Fixed #31548 -- Fixed URLValidator crash on non-strings.Yash Saini2020-05-081-0/+2
|
* Added URLValidator test for missing scheme.Yash Saini2020-05-081-0/+1
|
* Fixed #31267 -- Added tests cases with empty username or password for ↵Dennis Schwertel2020-02-132-2/+9
| | | | | | URLValidator. Follow up to cdcf4164bec9dc09465424d7042c3f9d4f0f1fdc.
* Fixed #30651 -- Made __eq__() methods return NotImplemented for not ↵ElizabethU2019-10-011-1/+2
| | | | | | | | | implemented comparisons. Changed __eq__ to return NotImplemented instead of False if compared to an object of the same type, as is recommended by the Python data model reference. Now these models can be compared to ANY (or other objects with __eq__ overwritten) without returning False automatically.
* Fixed #29860 -- Allowed BaseValidator to accept a callable limit_value.buzzi2018-10-221-0/+4
|
* Refactored validators tests to use subtests.Tom Forbes2018-08-181-45/+16
|
* Fixed #29528 -- Made URLValidator reject invalid characters in the username ↵Tim Bell2018-07-232-1/+7
| | | | and password.
* Fixed #29007 -- Fixed DecimalValidator crash on NaN, SNan, Inf, and Infinity ↵Fabio Bonelli2018-01-101-0/+8
| | | | values.
* Fixed #28562 -- Fixed DecimalValidator handling of positive exponent ↵Josh Schneier2017-09-271-0/+1
| | | | scientific notation.
* Added tests for DecimalValidator.Josh Schneier2017-09-111-0/+12
|
* Fixed #28201 -- Added ProhibitNullCharactersValidator and used it on ↵Alejandro Zamora2017-08-121-5/+27
| | | | CharField form field.
* Used assertRaisesMessage() to test Django's error messages.Mads Jensen2017-07-291-1/+2
|
* Fixed #28165 -- Ignored case in FileExtensionValidator's allowed_extensions.Arne de Laat2017-06-071-0/+9
|
* Added FileExtensionValidator tests for uppercase and missing file extensions.Arne de Laat2017-06-071-1/+7
|
* Refs #23919 -- Removed str_prefix usageClaude Paroz2017-01-201-7/+6
|
* Refs #23919 -- Removed django.utils._os.upath()/npath()/abspathu() usage.Tim Graham2017-01-201-2/+1
| | | These functions do nothing on Python 3.
* Refs #23919 -- Replaced io.open() with open().Aymeric Augustin2017-01-181-3/+2
| | | | io.open() is an alias for open() on Python 3.
* Refs #23919 -- Removed encoding preambles and future importsClaude Paroz2017-01-181-3/+0
|
* Fixed E305 flake8 warnings.Ramin Farajpour Cami2016-11-141-0/+2
|
* Refs #27392 -- Removed "Tests that", "Ensures that", etc. from test docstrings.za2016-11-101-1/+1
|
* Fixed #26578 -- Prohibited non-ASCII digits in validate_ipv4_address.wim glenn2016-10-281-0/+1
|
* Refs #21548 -- Skipped tests that rely on pillow when it's not installedBaptiste Mispelon2016-07-021-1/+11
|
* Fixed #21548 -- Added FileExtensionValidator and validate_image_file_extension.Berker Peksag2016-06-301-4/+47
|
* Fixed #26119 -- Fixed URLValidator crash on URLs with brackets.Christopher Grebs2016-06-281-0/+1
|
* Replaced use of TestCase.fail() with assertRaises().Tim Graham2016-06-281-5/+1
| | | Also removed try/except/fail antipattern that hides exceptions.
* Fixed #26204 -- Reallowed dashes in top-level domains for URLValidator.Tim Graham2016-02-182-1/+7
| | | | Thanks Shai Berger for the review.
* Fixed #26107 -- Added option to int_list_validator() to allow negative integers.Akshesh2016-02-181-0/+5
|
* Fixed #25637 -- Added URLValidator hostname length validation.Raphael Michel2015-12-082-0/+8
| | | | | URLValidator now validates the maximum length of a hostname and the maximum length of all labels inside the hostname.
* Fixed #25635 -- Made URLValidator allow '+' in scheme.Dheerendra Rathor2015-10-311-1/+2
|
* Fixed #25620 -- Made URLValidator prohibit URLs with consecutive dots in the ↵Dheerendra Rathor2015-10-291-0/+1
| | | | domain section.
* Fixed #24636 -- Added model field validation for decimal places and max digits.Iulia Chiriac2015-09-181-5/+24
|
* Refs #25345 -- Updated links to code.google.com.Maxime Lorant2015-09-041-1/+1
|
* Fixed #16501 -- Added an allow_unicode parameter to SlugField.Edward Henderson2015-07-171-1/+22
| | | | Thanks Flavio Curella and Berker Peksag for the initial patch.
* Fixed catastrophic backtracking in URLValidator.Shai Berger2015-07-083-0/+6
| | | | | | | Thanks João Silva for reporting the problem and Tim Graham for finding the problematic RE and for review. This is a security fix; disclosure to follow shortly.
* Prevented newlines from being accepted in some validators.Tim Graham2015-07-081-1/+14
| | | | | | This is a security fix; disclosure to follow shortly. Thanks to Sjoerd Job Postmus for the report and draft patch.
* Fixed #25059 -- Allowed Punycode TLDs in URLValidatorAlexey Sveshnikov2015-07-062-0/+2
|