summaryrefslogtreecommitdiff
path: root/tests/modeltests
AgeCommit message (Collapse)Author
2007-07-22Fixed #4373 -- Modified the get_object_or_404/get_list_or_404 shortcuts to ↵Gary Wilson Jr
also accept `QuerySet`s. Thanks SuperJared. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5746 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-21Fixed #4402 -- Modified test client to allow multi-valued inputs on GET ↵Russell Keith-Magee
requests. Thanks for the suggestion, eddymul@gmail.com. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5741 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-20Fixed #3782 -- Added support for the suite() method recommended by the ↵Russell Keith-Magee
Python unittest docs. Thanks for the suggestion, rene.puls@repro-mayr.de. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5729 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-14Fixed #4870 -- Removed unneeded import and fixed a docstring in an example.Malcolm Tredinnick
Thanks, Collin Grady. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5697 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-12Fixed #4526 -- Modified the test Client login method to fail when a user is ↵Russell Keith-Magee
inactive. Thanks, marcin@elksoft.pl. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5677 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-10Fixed #4804 -- Fixed a problem when validating choice lists with non-ASCIIMalcolm Tredinnick
data. Thanks, django@vonposer.de. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5642 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-05Added a test that shows the problem in #4470. This fails only for the mysql_oldMalcolm Tredinnick
backend. Refs #4470. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5617 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-04Merged Unicode branch into trunk (r4952:5608). This should be fullyMalcolm Tredinnick
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-01Made the reg-exp lookup tests more robust. they now pass for all databaseMalcolm Tredinnick
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-06-27Fixed #1465: added support for regex lookups. Thanks, Tom Tobin.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5555 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-01Fixed #3466 -- Fixed problem with specifyin a 'fields' argument to a JSON ↵Russell Keith-Magee
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-05-31Fixed #3050: you can now use extra(select=...) with values(). Thanks, Honza KralJacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5385 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-21Fixed #2365, #3324 -- Renamed FloatField to DecimalField and changed the codeMalcolm Tredinnick
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-14Changed the fix from [5231] so that the backwards-incompatibility is made moreMalcolm Tredinnick
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-12Added docs for form_for_model and form_for_instance, and added a fields ↵Russell Keith-Magee
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-10Improved error reporting for assertions where there are no form errors, or a ↵Russell Keith-Magee
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-10Added configurable arguments to assertRedirects and assertContains to allow ↵Russell Keith-Magee
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-08Added redirection for email services during test conditions.Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5173 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-08Moved generic relations into django.contrib.contenttypes, since it depends onMalcolm Tredinnick
that to work. Backwards incompatible change. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5172 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-07Added assertFormError, assertTemplateUsed and assertTemplateNotUsed for use ↵Russell Keith-Magee
during unit testing. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5156 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-06Fixed comma splice in error message introduced in [5133]Adrian Holovaty
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5154 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-05Backwards incompatible change: Changed the way test.Client.login operates. ↵Russell Keith-Magee
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-05Added a default test Client to TestCase, and added some assertions for some ↵Russell Keith-Magee
common testing patterns. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5150 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-01Fixed #4130 -- Added more self-explanatory error message when a typo is made inMalcolm Tredinnick
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-04-28Fixed #3268 -- Changed default model formfields to use a select widget when theMalcolm Tredinnick
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-09Fixed #3929 -- Newforms Textarea widget now always includes 'rows' and ↵Adrian Holovaty
'cols' attributes, even if you don't pass them in, for HTML correctness. Thanks, and welcome back, Luke Plant git-svn-id: http://code.djangoproject.com/svn/django/trunk@4961 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-03-31Fixed #2363 -- Improved base class checking in ModelBase metaclass. Thanks toMalcolm Tredinnick
combined work from phil.h.smith@gmail.com and Chris.Wesseling@cwi.nl. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4881 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-03-23Removed formatting from the select_related test title.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4797 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-03-23Renumbered all the doctest examples so that they are ordered correctly on ↵Jacob Kaplan-Moss
the doc pages. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4796 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-03-22Fixes #3212 -- Added code to test client to allow posting of multi-form ↵Russell Keith-Magee
values (e.g., MultipleChoiceFields). Thanks, Ben Dean Kawamura. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4774 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-03-20Fixed tests that broke after [4756].Malcolm Tredinnick
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4759 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-03-13Modified expected output of one fixture doctest to make it non unix-specific.Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4716 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-03-13Modified the internal dumpdata implementation to return the dumped data, ↵Russell Keith-Magee
rather than just printing to screen. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4715 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-03-01Fixes #2333 -- Added test fixtures framework.Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4659 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-28Added a "depth" argument to select_related() to control how many "levels" of ↵Jacob Kaplan-Moss
relations select_related() is willing to follow (refs #3275). Also added unit tests for select_related(). git-svn-id: http://code.djangoproject.com/svn/django/trunk@4645 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-26Fixed a few Python2.3-related bugs in the tests (see #3396). A few more ↵Jacob Kaplan-Moss
left, though. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4614 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-26Fixed #3390: the serializer can now contain forward references. Thanks, Russ.Jacob Kaplan-Moss
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4610 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-26Fixed #3172: Model.validate() no longer raises TypeErrors on empty ↵Jacob Kaplan-Moss
Date*Fields. Thanks, floguy@gmail.com. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4592 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-21Changed database PhoneNumberField to use USPhoneNumberField as its newforms ↵Adrian Holovaty
form field (instead of IntegerField) git-svn-id: http://code.djangoproject.com/svn/django/trunk@4556 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-21Fixed #3534 -- newforms ModelChoiceField and ModelMultipleChoiceField no ↵Adrian Holovaty
longer cache choices. Instead, they calculate choices via a fresh database query each time the widget is rendered and clean() is called git-svn-id: http://code.djangoproject.com/svn/django/trunk@4552 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-20Fixed #3247 -- newforms form_for_model() and form_for_instance() no longer ↵Adrian Holovaty
create form fields for database fields with editable=False. Thanks for the patch, mssnlayam@yahoo.com and Philipp Keller git-svn-id: http://code.djangoproject.com/svn/django/trunk@4548 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-20Fixed #3257 -- Added newforms ModelChoiceField and ModelMultipleChoiceField, ↵Adrian Holovaty
which are now used by form_for_model() and form_for_instance(). Thanks for the patch, Honza Kral, floguy@gmail.com and kilian.cavalotti git-svn-id: http://code.djangoproject.com/svn/django/trunk@4547 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-17Fixed #3160 -- Added the ability to control the content type in a test ↵Russell Keith-Magee
client POST request. This is to allow easier testing of json-rpc/xml-rpc/soap etc interfaces. Thanks to Mikeal Rogers for the suggestion, and Ben <afternoon@uk2.net> for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4529 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-14Changed __year lookup to use a BETWEEN SQL statement instead of comparing ↵Adrian Holovaty
the result of EXTRACT(year). This should be more efficient. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4505 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-12#fixed #2256 -- Made count() interact with slicing on QuerySets. Patch fromMalcolm Tredinnick
SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4488 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-11Fixed #3162 -- Added coded to catch and rethrow exceptions that are thrown ↵Russell Keith-Magee
by the views visited by the test client. Thanks, Ben <afternoon@uk2.net>. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4482 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-10Fixed #3463 -- EmptyQuerySet's iterator() now returns a generator. Thanks, ↵Adrian Holovaty
Gary Wilson git-svn-id: http://code.djangoproject.com/svn/django/trunk@4475 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-10Fixed #2348 -- Improved error reporting when query filter arguments areMalcolm Tredinnick
misspelt. Variation on a patch from Karen Tracey. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4470 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-09Added a ``session`` attribute to the test Client, to make it easier to test ↵Russell Keith-Magee
if session variables have been modified in a view. Also renamed Client.cookie to Client.cookies, to match documentation and common sense. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4464 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-01-29Fixed Python 2.4-ism in modeltests/test_client. Thanks for the find, Robert ↵Jacob Kaplan-Moss
Myers. git-svn-id: http://code.djangoproject.com/svn/django/trunk@4451 bcc190cf-cafb-0310-a4f2-bffc1f526a37