summaryrefslogtreecommitdiff
path: root/tests/modeltests/validation
AgeCommit message (Collapse)Author
2013-02-26Merged regressiontests and modeltests into the test root.Florian Apolloner
2013-02-23Fixed errors introduced in 21f333bcefccc151d6439246f8203d609ab6ca79. Refs #17751Florian Apolloner
2013-02-23Fix #17751: Added stripping of whitespace for ↵Erik Romijn
IPAddressField/GenericIPAddressField
2012-09-07[py3k] Silence many warnings while running the tests.Alex Gaynor
2012-09-01Fixed #18212 -- Standardized arguments of GenericIPAddressFieldClaude Paroz
Unlike other model fields, the newly introduced (1.4) GenericIPAddressField did not accept verbose_name and name as the first positional arguments. This commit fixes it. Thanks Dan McGee for the report and the patch.
2012-08-15Made the validation tests python3 friendly.Alex Gaynor
2012-08-12[py3] Refactored __unicode__ to __str__.Aymeric Augustin
* Renamed the __unicode__ methods * Applied the python_2_unicode_compatible decorator * Removed the StrAndUnicode mix-in that is superseded by python_2_unicode_compatible * Kept the __unicode__ methods in classes that specifically test it under Python 2
2012-08-07Fix a test that relied on an exception outliving the `except` block, which ↵Alex Gaynor
doesn't happen on py3k.
2012-06-07Fixed #18269 -- Applied unicode_literals for Python 3 compatibility.Claude Paroz
Thanks Vinay Sajip for the support of his django3 branch and Jannis Leidel for the review.
2012-05-31Fixed #18407 -- Made model field's to_python methods fully accept unicode.Claude Paroz
When generating error message in to_python, any unicode string containing non-ascii characters triggered a UnicodeEncodeError for most field types.
2012-05-31Rewrote test_error_messages with helper test utility.Claude Paroz
2012-04-29Fixed #18013 -- Use the new 'as' syntax for exceptions.Claude Paroz
Thanks Clueless for the initial patch. Note that unittest has been purposely left out (external package only used by Python 2.6).
2012-03-31Removed deprecated URLField.verify_exists.Aymeric Augustin
The deprecation schedule was slightly accelerated because of possible security ramifications. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17847 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2012-03-30Removed with_statement imports, useless in Python >= 2.6. Refs #17965. ↵Claude Paroz
Thanks jonash for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17828 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-11-18Added support for time zones. Thanks Luke Plant for the review. Fixed #2626.Aymeric Augustin
For more information on this project, see this thread: http://groups.google.com/group/django-developers/browse_thread/thread/cf0423bbb85b1bbf git-svn-id: http://code.djangoproject.com/svn/django/trunk@17106 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-31Fixed #16816 -- Tweaked the test mock for `URLField.verify_exists` to allow ↵Julien Phalip
tests to pass when there is no Internet connection available. Many thanks to Ramiro Morales, Aymeric Augustin and Florian Apolloner for the patch reviews. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17059 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-28Tweaked some `AutoField` tests to not raise wanings in Python>=2.6, where ↵Julien Phalip
`BaseException.message` has been deprecated. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17045 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-16Made an `AutoField` test more robust.Julien Phalip
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16992 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-14Switch several assertNumQueries to use the context manager, which is much ↵Alex Gaynor
more beautiful. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16986 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-13Convert all modeltests to use absolute imports, rather than relative ones.Alex Gaynor
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16975 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-13Fixed a couple of `assert` syntax warnings mistakingly introduced in r16966 ↵Julien Phalip
and added some tests to prevent future regressions. Thanks to Anssi Kääriäinen for the report. Refs #12467. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16971 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-13Fixed #12467 -- Made the model data validation for `DateField` and ↵Julien Phalip
`DateTimeField` more useful by actually telling what was the value that failed. Also did a bit of PEP8 cleanup in the area. Thanks to knutin for the report, to raulcd for the initial patch and to charettes for the review. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16966 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-09-10Altered the behavior of URLField to avoid a potential DOS vector, and to ↵Russell Keith-Magee
avoid potential leakage of local filesystem data. A security announcement will be made shortly. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16760 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-22Improved error message display during validation errors.Malcolm Tredinnick
When reporting a validation error (during model validation or fixture loading, for example), the error messages now report the bad value as well as the expected type. This can make identifying the offending field and problem a bit easier. Fixed #11595. Patch from raulcd and wildfire with supervision from Russell. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16638 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-13Fixed #16225 -- Removed unused imports. Many thanks to Aymeric Augustin for ↵Jannis Leidel
the work on the patch and Alex for reviewing. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16539 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-04Removed superflous commented-out lines.Ramiro Morales
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16502 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-07-03Renamed a test model field added in [16345] so it doesn't keep the test DB ↵Ramiro Morales
ceation process from finishing under Oracle. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16499 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-13Fixed #16246 -- Fixed GenericIPAddressField tests on PostgreSQL.Jannis Leidel
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16395 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-13Shortened some test model names that were introduced in r16366 to fix ↵Jannis Leidel
running tests on PostgreSQL. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16393 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-11Fixed #811 -- Added support for IPv6 to forms and model fields. Many thanks ↵Jannis Leidel
to Erik Romijn. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16366 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-10Made `with` statements added in [16348] compatible with Python 2.5.Ramiro Morales
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16357 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-09Clean up unique validation tests to not use bare excepts and use ↵Andrew Godwin
assertRaises. Refs [16345]. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16348 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-06-09Fixed #8913 - Make "must be unique" error messages customisable. Thanks to ↵Andrew Godwin
Leah Culver. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16345 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-05-05Fixes #15975 -- Test failure in model validation tests due to us now having ↵Chris Beaven
https://www.djangoproject.com git-svn-id: http://code.djangoproject.com/svn/django/trunk@16163 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-16Fixed #15229 -- Improved URLValidator to accept ftp:// links. Thanks, ↵Adrian Holovaty
codefisher and crayz_train git-svn-id: http://code.djangoproject.com/svn/django/trunk@15847 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-03Updated test assertions that have been deprecated by the move to unittest2. ↵Russell Keith-Magee
In summary, this means: assert_ -> assertTrue assertEquals -> assertEqual failUnless -> assertTrue For full details, see http://www.voidspace.org.uk/python/articles/unittest2.shtml#deprecations git-svn-id: http://code.djangoproject.com/svn/django/trunk@15728 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-01-09Fixed #14951 -- Made the unique_for_{date,month,year} model field ↵Ramiro Morales
constraints to not fail when the related DateField is empty. Existing modelforms tests were extended to cover this case and an equivalent set of tests was added for the model functionality. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15167 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-12Fixed #5416 -- Added TestCase.assertNumQueries, which tests that a given ↵Alex Gaynor
function executes the correct number of queries. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14183 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-11Fixed #12991 -- Added unittest2 support. Thanks to PaulM for the draft ↵Russell Keith-Magee
patch, and to Luke, Karen, Justin, Alex, Łukasz Rekucki, and Chuck Harmston for their help testing and reviewing the final patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14139 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-09-13Fix a couple of typos in test names and descriptions.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13821 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-17Fixed #14102 -- Ensure that fields that have been excluded from a form ↵Russell Keith-Magee
aren't included in the unique_for_* checks, either. Thanks to Travis Cline for the report and fix. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13598 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-16Fixed #12881: Corrected handling of inherited unique constraints. Thanks for ↵Karen Tracey
report fgaudin. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12797 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-10Fixed #12647. Allow unique_together checks be specified as lists as well as ↵Joseph Kocherhans
tuples. Thanks, Honza Král. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12403 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-29Tweaked the validation test models to avoid tripping over the fact that ↵Karen Tracey
Oracle doesn't like columns named 'number'. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12358 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-21Fixed #12582. Model validation on ForeignKeys now respects limit_choices_to. ↵Joseph Kocherhans
Thanks, Honza Král. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12271 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-14Fixed #12560. Changed validate_unique to stop checking null primary key ↵Joseph Kocherhans
values. Thanks, Honza Král. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12227 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-12Fixed #12512. Changed ModelForm to stop performing model validation on ↵Joseph Kocherhans
fields that are not part of the form. Thanks, Honza Kral and Ivan Sagalaev. This reverts some admin and test changes from [12098] and also fixes #12507, #12520, #12552 and #12553. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12206 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-05Merged soc2009/model-validation to trunk. Thanks, Honza!Joseph Kocherhans
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12098 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-14Fixed #8206 -- Removed validate methods of Model and Model fields. They are ↵Gary Wilson Jr
are unsupported for 1.0 and will be replaced with more complete model validation (refs #6845). git-svn-id: http://code.djangoproject.com/svn/django/trunk@8348 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-29Fixed #7560 -- Moved a lot of the value conversion preparation forMalcolm Tredinnick
loading/saving interactions with the databases into django.db.backend. This helps external db backend writers and removes a bunch of database-specific if-tests in django.db.models.fields. Great work from Leo Soto. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8131 bcc190cf-cafb-0310-a4f2-bffc1f526a37