summaryrefslogtreecommitdiff
path: root/tests/modeltests/test_client/models.py
AgeCommit message (Collapse)Author
2013-02-26Merged regressiontests and modeltests into the test root.Florian Apolloner
2012-09-26Fixed #17899 -- Rewrote [Ee]-mail to [Ee]mailAdrien Lemaire
2012-08-14[py3] Compared response.content with 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.
2012-05-03Replaced deprecated TestCase methods. Refs #17049.Claude Paroz
2012-04-30Ensured tests pass using custom PASSWORD_HASHERS.Anssi Kääriäinen
2012-04-14Converted more test assertions to assert[Not]Contains.Claude Paroz
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17910 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-08-12Fixed #4617 -- Added `raise_exception` option to `permission_required` ↵Jannis Leidel
decorator to be able to raise a PermissionDenied exception instead of redirecting to the login page. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16607 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
2010-12-22Fixed #14939: Don't strip ;-parameters from URLs in the test client.Andrew Godwin
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15027 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-12-04Removed all usages of deprecated TestCase methods (self.fail*). This ↵Alex Gaynor
removed most of the Warnings emitted (with -Wall) during the test suite. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14803 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-12Fixed #9002 -- Added a RequestFactory. This allows you to create request ↵Russell Keith-Magee
instances so you can unit test views as standalone functions. Thanks to Simon Willison for the suggestion and snippet on which this patch was originally based. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14191 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-10Fixed #12226 -- Deprecated test client Response.template attribute in favor ↵Carl Meyer
of templates attribute, which is always a list. Thanks Russell for patch review. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14106 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-09Fixed #14378 -- Made the test client class customizable. Thanks to Ned ↵Russell Keith-Magee
Batchelder for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14058 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-27Fixed #14116 -- Added a flag to enable CSRF checks in the test client. ↵Russell Keith-Magee
Thanks to jon@licq.org for the suggestion. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13640 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-13Fixed #12011 -- Modified the test client to preserve the request scheme on a ↵Russell Keith-Magee
redirect. Thanks to tgardner for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12419 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-30Fixed #9978 -- Fixed a KeyError exception that was being raised when using ↵Gary Wilson Jr
the logout method on the test client on an unauthenticated user, based on patch from ericholscher. git-svn-id: http://code.djangoproject.com/svn/django/trunk@10228 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-27Fixed #4476 -- Added a ``follow`` option to the test client request methods. ↵Russell Keith-Magee
This implements browser-like behavior for the test client, following redirect chains when a 30X response is received. Thanks to Marc Fargas and Keith Bussell for their work on this. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9911 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-12-08Added a 'permanent' argument the simple.redirect_to() generic view. It's ↵Adrian Holovaty
True by default, to match existing behavior. If set to False, the redirect will be a 302 instead of a 301. This is technically backwards-incompatible if you were using the redirect_to generic view with a format-string key called 'permanent', which is highly, highly unlikely. git-svn-id: http://code.djangoproject.com/svn/django/trunk@9594 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-12Fixed a couple typos in the modeltests' descriptions and made use of ReST ↵Gary Wilson Jr
inline literal markup for code snippets. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8325 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-12Fixed #7583 -- Corrected the testing docs that referred to the defunct ↵Russell Keith-Magee
headers attribute of the response. Added a test case to validate (and document) the new behavior. Thanks to Malcolm for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@7900 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-01Fixed #6068 -- Updated docstrings in model tests to make the documentationMalcolm Tredinnick
examples correct. Thanks Wang Chun. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6813 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-11When using assertRedirect(), allow the caller to specify relative URLs andMalcolm Tredinnick
automatically fill in the hostname and scheme (host can be passed in, if different from the default). git-svn-id: http://code.djangoproject.com/svn/django/trunk@6661 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-11-07Fixed #4376 -- login_required now works with bound methods. Thanks, Steven ↵Luke Plant
Bethard. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6658 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14Fixed #5394 -- REDIRECT_FIELD_NAME is now configurable. Thanks, Petr ↵Adrian Holovaty
Marhoun, DavidReynolds and effbot git-svn-id: http://code.djangoproject.com/svn/django/trunk@6206 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14Fixed a bunch of Python 2.3 issues. Two tests still fail, but this fixes the ↵Malcolm Tredinnick
bulk of things. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6183 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14Fixed tests to match new HTTP redirect behaviour. We always redirect to ↵Malcolm Tredinnick
absolute URLs now. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6169 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-14Fixed #987 -- Convert relative URI portions into absolute URIs in HTTP ↵Malcolm Tredinnick
Location headers. Based on a patch from SmileyChris. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6164 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-09-03Fixed #4988 -- In the test client, Added tracking of the client and request ↵Russell Keith-Magee
that caused a response so that the assertRedirects check can use the correct client when following a redirect. Well spotted, alex@gc-web.de. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6039 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-31Fixed #4968 -- Added assertRedirects handling for paths with GET data. ↵Russell Keith-Magee
Thanks for the patch, Ivan Sagalaev. git-svn-id: http://code.djangoproject.com/svn/django/trunk@6031 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-17Added docstring to logout test case.Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5917 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-17Fixed #5189 -- Added logout method to test Client. Thanks, Jakub Wisniowski ↵Russell Keith-Magee
<restless.being@gmail.com>. git-svn-id: http://code.djangoproject.com/svn/django/trunk@5916 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-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-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-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-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-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-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-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-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-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-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-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
2006-09-02Refs #2333 - Added model test for the test Client. Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3708 bcc190cf-cafb-0310-a4f2-bffc1f526a37