summaryrefslogtreecommitdiff
path: root/tests/regressiontests/forms/models.py
AgeCommit message (Collapse)Author
2013-02-26Merged regressiontests and modeltests into the test root.Florian Apolloner
2012-11-05Fixed #8627 -- Prevented textareas to swallow first newline contentClaude Paroz
Browsers consider the first newline in textareas as some display artifact, not real content. Hence they are not sending it back to the server. If we want to keep initial newlines, we have to add one when we render the textarea. Thanks bastih for the report and initial patch.
2012-10-03Fixed #14567 -- Made ModelMultipleChoiceField return EmptyQuerySet as empty ↵Stephen Burrows
value
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-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 much of the regression tests to use absolute imports. There's still ↵Alex Gaynor
work to be done though. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16976 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-18Fixed #14234 -- Re-validating a model instance added via ModelForm no longer ↵Carl Meyer
throws spurious PK uniqueness errors. Thanks to David Reynolds and Jeremy Dunck. Also moved Model._adding to Model._state.adding to reduce instance namespace footprint. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14612 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-16Migrated forms (minus localflavor) doctests. A huge thanks to Daniel ↵Russell Keith-Magee
Lindsley for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14570 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-08-14Fixed #13679, #13231, #7287 -- Ensured that models that have ↵Russell Keith-Magee
ForeignKeys/ManyToManyField can use a a callable default that returns a model instance/queryset. #13679 was a regression in behavior; the other two tickets are pleasant side effects. Thanks to 3point2 for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13577 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-08Fixed #11940 - ModelForm evaluates callable default values on form class ↵Luke Plant
creation Thanks to Harm Geerts for the report and initial patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12721 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-16Fixed a form test from [12211] that didn't clean up after itself. Thanks, ↵Jacob Kaplan-Moss
Alex Gaynor. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12232 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-12Fixed #12510. Changed ModelChoiceField to stop using some of its ↵Joseph Kocherhans
superclasses implementation. This could cause more than one query when generating choices. Thanks, Petr Marhoun and Honza Kral. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12211 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-10Fixed #10792 -- Ensured that ModelChoiceFields don't provide an empty option ↵Russell Keith-Magee
when the underlying field has blank=False and there is a default value available. Thanks to carljm for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10729 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-05-07Make sure that all uses of max_length in the test suite use values smaller ↵Jacob Kaplan-Moss
than 255. If we use max_length > 255 the test suite can't be run on MySQL 4. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10697 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-16Fixed #10363 -- Modified ModelForm handling to ensure that excluded fields ↵Russell Keith-Magee
can't be saved onto the model. Thanks to jgoldberg for the report, an Alex Gaynor for the fix. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10575 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-05Made a set of small test changes to avoid leaving temp files hanging around ↵Karen Tracey
after running the test suite. First, fixed a couple of places where temp dirs were (or could be) created without later being deleted. Second, added a missing close() before unlink() since Windows raises an error on an attempt to remove an open file. Finally, in the file_uploads tests, avoided opening-by-name temporary files that we already have a descriptor for. Doing additional opens seems to run afoul of the Windows issue with deleting open files, so it generally works better to just seek back to 0 instead of calling open multiple times. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10406 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-01-16Fixed #10041: use a tempdir for files in the forms test. Thanks, Marty Alchin.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9765 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-10Fixed #7830 -- Removed all of the remaining, deprecated, non-oldforms features:Gary Wilson Jr
* Support for representing files as strings was removed. Use `django.core.files.base.ContentFile` instead. * Support for representing uploaded files as dictionaries was removed. Use `django.core.files.uploadedfile.SimpleUploadedFile` instead. * The `filename`, `file_name`, `file_size`, and `chuck` properties of `UploadedFile` were removed. Use the `name`, `name`, `size`, and `chunks` properties instead, respectively. * The `get_FIELD_filename`, `get_FIELD_url`, `get_FIELD_size`, and `save_FIELD_file` methods for Models with `FileField` fields were removed. Instead, use the `path`, `url`, and `size` attributes and `save` method on the field itself, respectively. * The `get_FIELD_width` and `get_FIELD_height` methods for Models with `ImageField` fields were removed. Use the `width` and `height` attributes on the field itself instead. * The dispatcher `connect`, `disconnect`, `send`, and `sendExact` functions were removed. Use the signal object's own `connect`, `disconnect`, `send`, and `send` methods instead, respectively. * The `form_for_model` and `form_for_instance` functions were removed. Use a `ModelForm` subclass instead. * Support for importing `django.newforms` was removed. Use `django.forms` instead. * Support for importing `django.utils.images` was removed. Use `django.core.files.images` instead. * Support for the `follow` argument in the `create_object` and `update_object` generic views was removed. Use the `django.forms` package and the new `form_class` argument instead. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8291 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-21Corrected typo.Gary Wilson Jr
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8013 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-19Fixed #6009 -- Added regression tests to show that uploading non-ASCIIMalcolm Tredinnick
filenames now works properly. Patch from Leah Culver. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7987 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-19Fixed #7741: django.newforms is now django.forms. This is obviously a ↵Jacob Kaplan-Moss
backwards-incompatible change. There's a warning upon import of django.newforms itself, but deeper imports will raise errors. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7971 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-18Fixed #5975 -- Gave `ModelChoiceField` and `ModelMultipleChoiceField` ↵Gary Wilson Jr
ability to specify custom error messages. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6694 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-22Changed field to "def_date" from "date" in new tests from [6568] so we can ↵Matt Boersma
run the test suite against Oracle again. Refs #4140. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6595 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-20Fixed #899 -- Use model field default values as formfield initial values inMalcolm Tredinnick
form_for_model(). Patch from David Danier and PhiR. Thanks. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6568 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-15Fixed #4415 -- Added formfield method to PositiveIntegerField, so that those ↵Russell Keith-Magee
fields get validated correctly. Thanks, Oggie Rob. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6252 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-12Removed unit tests added in [5196]; didn't notice the tests in ↵Russell Keith-Magee
modeltests/model_forms. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5201 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-12Added unit tests for form_for_model and form_for_instance.Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5196 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-10-28Split django.newforms into forms, fields, widgets, util. Also moved unit ↵Adrian Holovaty
tests from docstrings to a standalone module in tests/regressiontests/forms, to save docstring memory overhead, keep code readable and fit our exisitng convention git-svn-id: http://code.djangoproject.com/svn/django/trunk@3945 bcc190cf-cafb-0310-a4f2-bffc1f526a37