Commit Graph

459 Commits

Author SHA1 Message Date
Russell Keith-Magee 7a198f5105 Fixed #3770 -- Remove null=True tag from OneToOne serialization test. OneToOne fields can't have a value of null.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5659 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-12 11:24:16 +00:00
Russell Keith-Magee 2d6d20def7 Fixed #4459 -- Added 'raw' argument to save method, to override any pre-save processing, and modified serializers to use a raw-save. This enables serialization of DateFields with auto_now/auto_now_add. Also modified serializers to invoke save() directly on the model baseclass, to avoid any (potentially order-dependent, data modifying) behavior in a custom save() method.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5658 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-12 07:45:35 +00:00
Malcolm Tredinnick 87d8976fae Fixed #4804 -- Fixed a problem when validating choice lists with non-ASCII
data. Thanks, django@vonposer.de.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5642 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-10 12:03:36 +00:00
Malcolm Tredinnick 8c85ddf306 Fixed #4772 -- Fixed reverse URL creation to work with non-ASCII arguments.
Also included a test for non-ASCII strings in URL patterns, although that
already worked correctly.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5630 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-07 18:24:27 +00:00
Gary Wilson Jr 0816f380d2 Fixed #4779 -- Fixed a couple typos in the `test_client_regress` tests that surfaced when typo was corrected in [5620]. Thanks ferringb@gmail.com.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5621 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-06 04:04:42 +00:00
Malcolm Tredinnick d0b627acc2 Added a test that shows the problem in #4470. This fails only for the mysql_old
backend. Refs #4470.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5617 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-05 10:27:22 +00:00
Malcolm Tredinnick 953badbea5 Merged Unicode branch into trunk (r4952:5608). This should be fully
backwards compatible for all practical purposes.

Fixed #2391, #2489, #2996, #3322, #3344, #3370, #3406, #3432, #3454, #3492, #3582, #3690, #3878, #3891, #3937, #4039, #4141, #4227, #4286, #4291, #4300, #4452, #4702


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5609 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-04 12:11:04 +00:00
Malcolm Tredinnick 3a892122f2 Made the reg-exp lookup tests more robust. they now pass for all database
backends and are not dependent on locale sorting order.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5579 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-01 04:47:46 +00:00
Jacob Kaplan-Moss 24512a74be Fixed #1465: added support for regex lookups. Thanks, Tom Tobin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5555 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-27 18:58:10 +00:00
Malcolm Tredinnick a5802b35dd Fixed #4453 -- Allow dots in URL pattern names (although the string in that case is first tried as an import path and only then falls back to being treated as a pattern).
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5530 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-25 04:34:34 +00:00
Malcolm Tredinnick ac64e91a0c Merged boulder-oracle-sprint branch (r3965:5512) back into trunk. All
expected tests pass for all databases.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5519 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-23 14:16:00 +00:00
Malcolm Tredinnick 553a20075e Fixed #4527 -- Changed the way errors are displayed in Form.as_p() to avoid
invalid XHTML constructs. Based on a patch from SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5518 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-23 06:19:26 +00:00
Malcolm Tredinnick dfea6bdfa5 Fixed #4630 -- Fixed some validation problems with SplitDateTimeField. Thanks
glin@seznam.cz and SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5515 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-23 03:32:59 +00:00
Malcolm Tredinnick 284c6ba44b Fixed #4657 -- Fixed an error in an edge case of the urlizetrunc filter.
Thanks, SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5513 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-23 03:10:32 +00:00
Malcolm Tredinnick a33fb695e3 Fixed #4475 -- Fixed a problem that was preventing streaming tests for the
serializers from ever being run. Based on a patch from ian.g.kelly@gmail.com.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5453 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-10 03:06:34 +00:00
Russell Keith-Magee 16269c4d0a Fixed #3523 -- Added list unpacking to for loops in templates. Thanks to SmileyChris and Honza Kral for their work.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5443 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-08 11:58:03 +00:00
Russell Keith-Magee ea07351799 Fixed #3466 -- Fixed problem with specifyin a 'fields' argument to a JSON serializer. Also added documenation for the 'fields' argument.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5409 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-01 13:39:08 +00:00
Jacob Kaplan-Moss bf2e62aa3c Fixed #3050: you can now use extra(select=...) with values(). Thanks, Honza Kral
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5385 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-31 02:22:41 +00:00
Russell Keith-Magee c84ff156c1 Fixed a serialization problem with objects that have a foreign key on an object whose primary key is a OneToOneField.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5371 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-28 05:41:32 +00:00
Malcolm Tredinnick 193a83ca50 Added a new form test that I forgot to commit in [5348]. Refs #3718.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5354 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-26 09:47:47 +00:00
Malcolm Tredinnick 92c35a0617 Fixed #2365, #3324 -- Renamed FloatField to DecimalField and changed the code
to return Decimal instances in Python for this field. Backwards incompatible
change.

Added a real FloatField (stores floats in the database) and support for
FloatField and DecimalField in newforms (analogous to IntegerField).

Included decimal.py module (as django.utils._decimal) from Python 2.4. This is
license compatible with Django and included for Python 2.3 compatibility only.

Large portions of this work are based on patches from Andy Durdin and Jorge
Gajon.



git-svn-id: http://code.djangoproject.com/svn/django/trunk@5302 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-21 01:29:58 +00:00
Russell Keith-Magee edc0fcdf7c Moved markup tests into their contrib directory.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5297 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-20 04:08:14 +00:00
Russell Keith-Magee c9aa4c71ac Modified the django system test script to search for tests in the contrib apps.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5296 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-20 03:51:21 +00:00
Malcolm Tredinnick 534c0d8442 Fixed #4316 -- Added docstring and tests for django.newforms.utils.flatatt().
Thanks, Gary Wilson.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5291 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-19 18:49:35 +00:00
Malcolm Tredinnick 9ed4217a57 Fixed #4337 -- Added pop() method to QueryDict. Thanks, Gary Wilson.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5289 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-19 18:34:00 +00:00
Malcolm Tredinnick b996e214c0 Changed the fix from [5231] so that the backwards-incompatibility is made more
obvious and everything still has nice names.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5237 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-14 16:24:51 +00:00
Russell Keith-Magee 9350945963 Cleaned up the ordering of test data from [5232].
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5233 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-14 14:21:00 +00:00
Russell Keith-Magee c38a93e4d9 Fixed #4288 -- Modified serializers to pay attention to the to_field attribute on ForeignKeys. Thanks to Sandro Dentella for the report and the helpful test case.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5232 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-14 14:14:49 +00:00
Malcolm Tredinnick f15036ae6d Renamed form-specific cleaning methods to be do_clean_*, rather than clean_*.
This avoids a name clash that would occur when you had a form field called
"data" (because clean_data is already a dictionary on the Form class).

Backwards incompatible change.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5231 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-14 14:02:36 +00:00
Russell Keith-Magee c89dc9cfa0 Fixed some incorrect reporting of error messages in assertRedirects, and added test cases to validate.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5228 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-14 11:07:14 +00:00
Adrian Holovaty 2c86d57284 Added unit tests and docs for the newforms case in which the form's data doesn't include a value for a nonrequired field
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5218 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-14 02:57:42 +00:00
Russell Keith-Magee 2345029d0d Fixed #4018 -- Added code to allow callables as initial data in newforms. Thanks for the patch, David Danier.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5209 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-12 15:50:32 +00:00
Russell Keith-Magee 6aa5091d58 Added docs for form_for_model and form_for_instance, and added a fields argument so it is easy to create forms from a subset of model fields.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5202 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-12 14:42:46 +00:00
Russell Keith-Magee ca5e12b4ee Removed unit tests added in [5196]; didn't notice the tests in modeltests/model_forms.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5201 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-12 12:22:50 +00:00
Russell Keith-Magee 1bb3ed7264 Added unit tests for form_for_model and form_for_instance.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5196 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-12 04:19:21 +00:00
Malcolm Tredinnick f9982c5c08 Fixed #4270 -- Don't permit deleting of items from an immutable QueryDict.
Thanks, Gary Wilson.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5187 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-11 08:22:06 +00:00
Russell Keith-Magee 70902908c7 Improved error reporting for assertions where there are no form errors, or a non-existent field has been provided. Also created a test client regression test, to hold the tests validating the failure cases of the TestCase assertions.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5181 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-10 13:46:15 +00:00
Russell Keith-Magee 5c68ab6e29 Added configurable arguments to assertRedirects and assertContains to allow for other response status codes. Thanks for the suggestion, Jiri Barton.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5179 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-10 11:27:59 +00:00
Russell Keith-Magee 469314e7bc Added redirection for email services during test conditions.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5173 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-08 11:19:34 +00:00
Malcolm Tredinnick 1c53661bd1 Moved generic relations into django.contrib.contenttypes, since it depends on
that to work. Backwards incompatible change.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5172 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-08 10:59:35 +00:00
Malcolm Tredinnick 0839a0046a Fixed #4041 -- Added a __contains__ method to cache backends. Thanks, Gary
Wilson and SmileyChris.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5171 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-08 04:13:46 +00:00
Malcolm Tredinnick faa31732ca Fixed #3753 -- Allow optional display of invalid variable name in
TEMPLATE_STRING_IF_INVALID. Thanks, Matt McClanahan.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5167 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-08 03:36:16 +00:00
Russell Keith-Magee f073797f4c Added assertFormError, assertTemplateUsed and assertTemplateNotUsed for use during unit testing.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5156 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-07 12:34:18 +00:00
Adrian Holovaty 1889db475d Fixed comma splice in error message introduced in [5133]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5154 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-06 04:12:08 +00:00
Russell Keith-Magee 36b164d838 Backwards incompatible change: Changed the way test.Client.login operates. Old implemenation was fragile, and tightly bound to forms. New implementation interfaces directly with the login system, is compatible with any authentication backend, and doesn't depend upon specific template inputs being available.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5152 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-05 15:16:15 +00:00
Russell Keith-Magee a0ef3ba2f7 Added a default test Client to TestCase, and added some assertions for some common testing patterns.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5150 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-05 03:03:33 +00:00
Malcolm Tredinnick d943f5ae92 Fixed #4130 -- Added more self-explanatory error message when a typo is made in
a queryset field argument.

We may need to fine-tune the error message based on experience down the line,
but this stands as an improvement on its own. Thanks, Ned Batchelder.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5133 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-01 03:21:54 +00:00
Malcolm Tredinnick 0b2f9e89cd Fixed #3946 -- Added Swiss localflavor. Thanks, charly.wilhelm@gmail.com.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5132 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-01 03:10:10 +00:00
Malcolm Tredinnick d9f1a0aaef Renamed one test to avoid a name-clash with an earlier test of the same name.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5125 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-28 16:41:44 +00:00
Malcolm Tredinnick d9cc22b3e3 Fixed #3268 -- Changed default model formfields to use a select widget when the
field has a choices attribute. Based on a patch from mrmachine.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5119 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-04-28 14:18:03 +00:00