summaryrefslogtreecommitdiff
path: root/tests/modeltests/model_forms/models.py
AgeCommit message (Collapse)Author
2013-02-26Merged regressiontests and modeltests into the test root.Florian Apolloner
2012-12-19Fixed #18172 -- Made models with __iter__ usable in ModelMultipleChoiceFieldPatryk Zawadzki
Thanks to Patryk Zawadzki for the patch.
2012-12-08Removed US localflavor-specific tests from coreClaude Paroz
Also fixes #9045.
2012-08-14[py3] Fixed modeltests.model_forms tests.Chris Lawlor
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-07-22[py3] Replaced unicode/str by six.text_type/bytes.Aymeric Augustin
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.
2011-11-13Refs #17215: Avoid generating 47 leftover tmp dirs during a clean test run.Karen Tracey
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17094 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-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-06-10Fixed #16198 -- Ported the model_forms doctests. Our long national nightmare ↵Russell Keith-Magee
is over. Oh, and we have always been at war with doctests. Thanks to Peter van Kampen and Gregor Müllegger for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16358 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-04-22Fixed #6953 -- Correctly sort ManyToMany fields in ModelForms. Thanks, ↵Jannis Leidel
dgouldin, mk and Alex. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16063 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-09Fixed a bunch more tests that were failing in Oracle due to false ↵Ian Kelly
assumptions about the primary keys of objects. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15789 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-04Refs #15550 -- Corrected another primary-key ordering problem in the ↵Russell Keith-Magee
modelforms tests. Thanks to bberes for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15753 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-04Fixed #15550 -- Corrected an ordering dependency in the model_forms ↵Russell Keith-Magee
doctests. Thanks to bberes for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15745 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-26Revert [15653], which was absolutely not ready to be committed.Alex Gaynor
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15655 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-26Beginnings of test conversion.Alex Gaynor
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15653 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-02-19Fixed #9161 -- Ensure that ModelMultipleChoiceField respects to_field_name ↵Russell Keith-Magee
in validation. Thanks to Honza for the report, and Gregor Müllegger for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15587 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-08-06Fixed #8426 - added 'helptext' CSS class to help text in forms to aid in stylingLuke Plant
Thanks to erikcw for report, mrts and rpbarlow for patch git-svn-id: http://code.djangoproject.com/svn/django/trunk@13519 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-21Fixed the model_forms doctests to not depend on writer PKs, which are ↵Karen Tracey
db-dependent after r12797. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13015 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-31Restored pre-r10062 behavior allowing None from formfield_callback to ↵Brian Rosner
exclude itself from the form git-svn-id: http://code.djangoproject.com/svn/django/trunk@12891 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-14Fixed #6054: work around PIL's installation brokeness by detecting either of ↵Jacob Kaplan-Moss
the two ways it can end up being installed. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12429 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-10Fixed #9223 -- Added support for declarative widgets to ModelForm. I declare ↵Adrian Holovaty
thanks to isagalaev. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12194 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
2009-12-17Fixed #399: Added big integer field. Thanks to Tomáš Kopeček for ↵Karen Tracey
persistently maintaining a patch for this. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11887 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-28Changes to `ImageFileDescriptor` and `ImageField` to fix a few cases of ↵Gary Wilson Jr
setting image dimension fields. * Moved dimension field update logic out of `ImageFileDescriptor.__set__` and into its own method on `ImageField`. * New `ImageField.update_dimension_fields` method is attached to model instance's `post_init` signal so that: * Dimension fields are set when defined before the ImageField. * Dimension fields are set when the field is assigned in the model constructor (fixes #11196), but only if the dimension fields don't already have values, so we avoid updating the dimensions every time an object is loaded from the database (fixes #11084). * Clear dimension fields when the ImageField is set to None, which also causes dimension fields to be cleared when `ImageFieldFile.delete()` is used. * Added many more tests for ImageField that test edge cases we weren't testing before, and moved the ImageField tests out of `file_storage` and into their own module within `model_fields`. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10858 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-11Fixed #10404: ImageField height_field and width_field options no longer ↵Jacob Kaplan-Moss
depend on putting the image field after the height/width fields as they did after r9766. This bug actually exposed a related handful of inconsistancies in the underlying file handling and wraping, so a few related changes are in here as well: * Dimensions are also now calculated the moment the image is assigned to the field instead of upon save. * The base `File` object now when possible delegates its closed attribute down to the os-level file it wrapps. * In-memory files' `close()` now is a no-op. Without this certain APIs that should be able to handle in-memory files were failing. * Accessing `FieldFile.closed` used to open the file. That's silly, and it doesn't any more. * Some over-eager error handling was squishing some errors that would normally be raised. One unit test was incorrectly depending on this behavior, so the test was removed. Thanks to Armin Ronacher for much of this work. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10737 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-02Fixed #10349 -- Modified ManyToManyFields to allow initial form values to be ↵Russell Keith-Magee
callables. Thanks to fas for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10652 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-30Fixed #10134 -- Added unique_for_[date|day|month|year] validation to ↵Russell Keith-Magee
ModelForm handling. Thanks to Alex Gaynor for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10646 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30Fixed #8746: Check data in raw_id_fields more closely. Thanks, dgouldinJacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10233 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30Fixed #10149. FileFields in a form now validate max_length. Based on a patch ↵Joseph Kocherhans
by Massimo Scamarcia. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10227 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-17Fixed #10512 -- Corrected the handling of extra fields on a ModelForm. ↵Russell Keith-Magee
Thanks to Alex Gaynor for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10070 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-15Fixed #8164 -- Fields on a ModelForm are now ordered in the order specified ↵Russell Keith-Magee
in the fields attribute of the ModelForm's Meta class. Thanks to Alex Gaynor for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10062 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-16Fixed #10196: Restored setting of image file width and height fields lost in ↵Karen Tracey
r9766, and added tests for this function. Thanks to vicvicvic for the ticket and patch and for Alex for reminding me not to break non-PIL-boxes with the new tests. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9841 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-16Fixed #10121: Restored code lost in r9766 that prevented overwriting an ↵Karen Tracey
already-set blank=True FileField with blank. This would happen, for instance, in the admin if an object with a FileField was edited/saved but the file not re-uploaded, resulting in the association to the previously-uploaded file being lost. Adding the ability to re-blank FileFields when they are once set is the subject of a different ticket (#7048), for now the pre-9766 behavior here has just been restored in order to avoid unexpected data loss. Thanks to Alex for help in understanding how to fix this without un-doing the intent of r9766. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9840 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-23Fixed #10103: Testcase fix for Jython compatibility. Thanks for report and ↵Karen Tracey
patch leosoto. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9782 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-19Fixed #10069 -- Fixed the model form unique validation code to not proceed ↵Karen Tracey
with using, for example, RelatedObjects returned by get_field_by_name as though they were model Fields. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9777 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-05Fixed #9218 -- Simplified the fix from #9039 and added tests to ensure this ↵Karen Tracey
case doesn't break again (and that the simplification didn't break anything). git-svn-id: http://code.djangoproject.com/svn/django/trunk@9341 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-04Fixed #9418 -- When saving a model form, defer saving of file-type fields ↵Karen Tracey
until after other fields, so that callable upload_to methods can use data from the other fields. Thanks to Bernd Schlapsi for the report and initial patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9334 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-28Fixed #9039 take 2 -- Modified the new tests added in [9239] so they pass on ↵Karen Tracey
Oracle. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9288 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-21Fixed #9039 -- Don't perform unique checks on NULL values, since NULL != ↵Karen Tracey
NULL in SQL. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9239 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-10-10Yet more file storage testing cleanup for the sake of buildbots; this should ↵Jacob Kaplan-Moss
be the last of it, I hope. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9226 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-02Fixed #8795: unique_together validation no longer fails on model forms that ↵Jacob Kaplan-Moss
exclude fields included in the check. Thanks, Alex Gaynor. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8854 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-02Fixed #8196 -- Make the model_form tests also pass if you don't have PILMalcolm Tredinnick
installed. We weren't relying on PIL previously, but the output was different if it wasn't installed, which was triggering spurious failures. Patch from Marty Alchin. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8842 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01Fixed #8648 -- Admin no longer ignores to_field. Thanks for the help Karen ↵Brian Rosner
Tracey and SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8823 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01Fixed #8210 and #8664: moved `USStateField` and `PhoneNumberField` to ↵Jacob Kaplan-Moss
`django.contrib.localflavor.us`. This is a backwards-incompatible change, albeit a minor one; just add an aditional `import` and go on your way. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8819 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-09-01Repaired an oversight from [8772] that let made certain types of fields with ↵Jacob Kaplan-Moss
choices fail. Fixes #6967 again. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8806 bcc190cf-cafb-0310-a4f2-bffc1f526a37