summaryrefslogtreecommitdiff
path: root/tests/regressiontests/model_fields
AgeCommit message (Collapse)Author
2013-02-26Merged regressiontests and modeltests into the test root.Florian Apolloner
2013-02-23Proposed fix for #18162.Tomek Paczkowski
2012-12-08Fixed #19357 -- Allow non-ASCII chars in filesystem pathsClaude Paroz
Thanks kujiu for the report and Aymeric Augustin for the review.
2012-10-26Fixed #15040 - Boolean fields return 0 and 1 when loaded through select_relatedLuke Plant
Thanks to homm for the report and ramiro for the patch.
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-06Fixed #18724 -- Fixed IntegerField validation with value 0Brendan MacDonell
2012-07-22[py3] Removed longs.Aymeric Augustin
2012-07-06Used skipIf decorator to skip image tests when PIL is not availableClaude Paroz
2012-06-26Fixed #18515 -- Conditionally regenerated filename in FileField validationClaude Paroz
When a FileField value has been saved, a new validation should not regenerate a new filename when checking the length. Refs #9893.
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-22Fixed #18317 -- Removed db specific raw SQL function from testsAnssi Kääriäinen
A test in model_fields used LEN() in raw SQL. This function is not available on some 3rd party backends. I removed this function and ensured that the test works correctly (breaks pre e9bbdb39de) with the change.
2012-05-17Fixed #9893 -- Validated the length of file namesAymeric Augustin
after the full file name is generated by the storage class. Thanks Refefer for the report, carsongee for the patch, and everyone else involved in the discussion.
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).
2011-11-12Fix #16570: Restore ability to have decimal fields where max_digits equals ↵Karen Tracey
decimal_places. Thanks dcwatson and kenth. git-svn-id: http://code.djangoproject.com/svn/django/trunk@17089 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-10-13Convert the remainder of the relative imports in the tests to be absolute ↵Alex Gaynor
imports. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16981 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-08-13Fixed #14695 -- Stopped model fields from incorrectly overwriting the field ↵Jannis Leidel
name during model initialization if it was already passed as a keyword argument. Thanks, erikrose and willhardy. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16614 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-05-03Fixed #5931 -- Added __repr__ to db fields. Thanks, Thomas Güttler, ↵Jannis Leidel
emulbreh and magopian. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16145 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2011-03-10Fixed #15559 - distinct queries introduced by [15607] cause errors with some ↵Luke Plant
custom model fields This patch just reverts [15607] until a more satisfying solution can be found. Refs #11707 git-svn-id: http://code.djangoproject.com/svn/django/trunk@15791 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-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-02-21Fixed #11707 - limit_choices_to on a ForeignKey can render duplicate options ↵Luke Plant
in formfield Thanks to Chris Wesseling for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@15607 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-10-01Fixed #7048 -- Added ClearableFileInput widget to clear file fields. Thanks ↵Jannis Leidel
for report and patch, jarrow and Carl Meyer. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13968 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-04Fixed #12164 -- Removed the Python 2.3 compatibility imports and ↵Russell Keith-Magee
workarounds. Thanks to timo and claudep for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13094 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-09Fixed #13293 -- Corrected a problem with the MySQL handling of boolean ↵Russell Keith-Magee
return values when a query has an extra() clause. Thanks to mk for the report and draft patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12939 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-04-01Fixed #7190 -- Corrected a problem with Boolean value handling on the MySQL ↵Russell Keith-Magee
backend. Thanks to George Vilches for the initial patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12900 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-10Tests for [12744], which were accidentally left out of the commit. Refs #13071.James Bennett
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12745 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-07Fixed #12913. Fields with choices now respect show_hidden_initial as a ↵Joseph Kocherhans
keyword argument to formfield. Thanks, semenov. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12696 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-24Fixed #7190. Boolean fields now return bool values instead of 1 or 0. ↵Joseph Kocherhans
Thanks, Alex Gaynor. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12578 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-02-02Fixed #12667. Added optgroup validation support to model fields with ↵Joseph Kocherhans
choices. Thanks ramiro. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12374 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-09Fixed #10015 -- PostgreSQL 8.3+ no longer barfs when passing an integer as a ↵Adrian Holovaty
filter() value for a CharField or TextField. Thanks, carljm git-svn-id: http://code.djangoproject.com/svn/django/trunk@12150 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-22Fixed #1142 -- Added multiple database support.Russell Keith-Magee
This monster of a patch is the result of Alex Gaynor's 2009 Google Summer of Code project. Congratulations to Alex for a job well done. Big thanks also go to: * Justin Bronn for keeping GIS in line with the changes, * Karen Tracey and Jani Tiainen for their help testing Oracle support * Brett Hoerner, Jon Loyens, and Craig Kimmerer for their feedback. * Malcolm Treddinick for his guidance during the GSoC submission process. * Simon Willison for driving the original design process * Cal Henderson for complaining about ponies he wanted. ... and everyone else too numerous to mention that helped to bring this feature into fruition. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11952 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-29Added test for pickling of a model with an `ImageField`, refs #11103.Gary Wilson Jr
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10860 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-04-12Fixed #10692 -- Fixed DecimalField lookups for extreme values.Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10545 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-10Fixed #9640, #10549: BooleanFields with choices, a default, and null=False ↵Jacob Kaplan-Moss
now correctly doesn't generate a blank option. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10500 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-04-10Converted model_fields regression tests into unittests.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10499 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-11Fixed #5903 -- DecimalField.get_default() now correctly returns a Decimal ↵Brian Rosner
object when the model instance was not retrieved from the database. Thanks Justin Driscoll and pigletto. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9823 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-02Fixed #9706: made SlugField honor max_length in Oracle, matching the other ↵Ian Kelly
backends. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9548 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-11-12Fixed #5079 -- Avoid converting Decimals to floats during save to the database.Karen Tracey
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9394 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-29Fixed #8101 -- Allow the strings '1' and '0' as filter values for booleanMalcolm Tredinnick
fields (the latter was causing problems). This allows these values in URLs (e.g. the admin filtering). Not an ideal solution to the problem, but will do the job for the time being. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8691 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-27Removed oldforms, validators, and related code:Gary Wilson Jr
* Removed `Manipulator`, `AutomaticManipulator`, and related classes. * Removed oldforms specific bits from model fields: * Removed `validator_list` and `core` arguments from constructors. * Removed the methods: * `get_manipulator_field_names` * `get_manipulator_field_objs` * `get_manipulator_fields` * `get_manipulator_new_data` * `prepare_field_objs_and_params` * `get_follow` * Renamed `flatten_data` method to `value_to_string` for better alignment with its use by the serialization framework, which was the only remaining code using `flatten_data`. * Removed oldforms methods from `django.db.models.Options` class: `get_followed_related_objects`, `get_data_holders`, `get_follow`, and `has_field_type`. * Removed oldforms-admin specific options from `django.db.models.fields.related` classes: `num_in_admin`, `min_num_in_admin`, `max_num_in_admin`, `num_extra_on_change`, and `edit_inline`. * Serialization framework * `Serializer.get_string_value` now calls the model fields' renamed `value_to_string` methods. * Removed a special-casing of `models.DateTimeField` in `core.serializers.base.Serializer.get_string_value` that's handled by `django.db.models.fields.DateTimeField.value_to_string`. * Removed `django.core.validators`: * Moved `ValidationError` exception to `django.core.exceptions`. * For the couple places that were using validators, brought over the necessary code to maintain the same functionality. * Introduced a SlugField form field for validation and to compliment the SlugField model field (refs #8040). * Removed an oldforms-style model creation hack (refs #2160). git-svn-id: http://code.djangoproject.com/svn/django/trunk@8616 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-02Fixed #7920 -- Made tests compatible with Python 2.6's Decimal repr change, ↵Gary Wilson Jr
patch from Karen Tracey. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8190 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-30Fixed #8023 -- Allow filtering of DecimalFields (in models) using strings.Malcolm Tredinnick
At the same time, checked all other cases of db_prep_value() to ensure they aren't making the same mistake. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8143 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-30Since max_digits and decimal_places are required on ↵Malcolm Tredinnick
django.db.models.DecimalField, one of the tests was a bit bogus. Fixed that. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8142 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