summaryrefslogtreecommitdiff
path: root/django/test
AgeCommit message (Collapse)Author
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-11-30Ensured that the test suite creates the default DB before any others.Jacob Kaplan-Moss
Refs #14799. Technically this fixes the problem, but I'm far from convinced it's the perfect solution, so I'm leaving the ticket open. I'm committing this now because it's the minimum required to get the test suite running again, but this commit can -- and probably should -- be reverted in favor of a more holistic fix later on. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14756 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-25Fixed #14415 -- Corrected the process of creating and destroying test ↵Russell Keith-Magee
databases to prevent accidental deletion of the source database. Also improves the mirroring process to prevent some cross-connection effects. Thanks to Shai Berger for the help diagnosing and testing. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14696 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-11Fixed #14508 - test suite silences warnings.Luke Plant
Utility functions get_warnings_state and save_warnings_state have been added to django.test.utils, and methods to django.test.TestCase for convenience. The implementation is based on the catch_warnings context manager from Python 2.6. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14526 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-11Made the deprecation warning for reponse.template more useful by pointing to ↵Luke Plant
the caller. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14525 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-11-06Removed the use of a deprecated unittest method.Alex Gaynor
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14465 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-31Ensure that assertNumQueries doesn't swallow exceptions inside the function.Alex Gaynor
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14405 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-30Reordered the shutdown process for tests so that all tests force a ↵Russell Keith-Magee
connection close. This is required to prevent some cross-test failures. Thanks to Florian Apolloner for the report and help tracking down the problem. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14399 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-30Fixed #14588 -- Corrected r14393 to ensure that response middlewares are are ↵Russell Keith-Magee
always applied. Includes a battery of tests to validate the expected behavior of the middleware cycle. Thanks to Petr Marhoun for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14398 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-21Fixed #14520 -- fixed a memory leak when running the test suite.Alex Gaynor
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14312 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-18Fixed an naming problem with r14258. Thanks to Alex for the report.Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@14260 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-18Fixed #14487 -- Prevented unittest from leaking into scope via a 'from ↵Russell Keith-Magee
django.test.testcases import *' import. Thanks to Jannis for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14258 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-10-17Corrected the skipIfDBFeature and skipUnlessDBFeature decorators to actually ↵Russell Keith-Magee
*run* the tests they decorate. Thanks to Alex for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14243 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-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-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-11Fixed #14436 -- Escalated 1.2 PendingDeprecationWarnings to ↵Russell Keith-Magee
DeprecationWarnings, and removed 1.1 deprecated code. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14138 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 #12979 -- allowed using savepoints in TestCase (i.e. tests with ↵Alex Gaynor
transactions disabled), convert the GetOrCreate tests to use this. git-svn-id: http://code.djangoproject.com/svn/django/trunk@14061 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-09-26Fixed #13827 -- Cleaned up a few unnecessary function calls.Jannis Leidel
git-svn-id: http://code.djangoproject.com/svn/django/trunk@13876 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-08-21Fixed #13140 -- Ensure that request headers are preserved through redirect ↵Russell Keith-Magee
chains in the test client. Thanks to David Novakovic for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13620 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-20Fixed #13895 -- Refactored aggregation_regress doctests. Thanks to Alex ↵Russell Keith-Magee
Gaynor for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13614 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-06Fixed #11159 -- Added mimetype detection to the test client for file ↵Russell Keith-Magee
uploads. Thanks to notanumber for the report and patch, and lomin for the test case. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13517 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-06Fixed #13615 -- Clarified test assertion text to avoid confusion when ↵Russell Keith-Magee
response content isn't a web page. Thanks to DaNmarner for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13512 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-08-06Fixed #13092 -- Added support for the "in" operator when dealing with ↵Russell Keith-Magee
context lists. Thanks to clelland for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13510 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-05-28Fixed #13634 -- Migrated aggregation tests to use unittest. This removes a ↵Russell Keith-Magee
flush, which speeds up the tests overall. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13309 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-13Fixed #13332 -- Corrected the cleanup code in the test client to avoid a ↵Russell Keith-Magee
refcounting problem with signal handlers. This is a fix for the benefit of PyPy's hybrid GC. Thanks to Alex Gaynor for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12964 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-03-19Fixed #13152 -- Ensure the test client saves the session before writing the ↵Russell Keith-Magee
session key to the cookie, in case the session engine changes the session key. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12806 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-22Fixed #12932 -- Added an extra argument to suite_result() in the test ↵Russell Keith-Magee
runner, and added **kwargs as protection against future changes. Thanks to Eric Holscher for the report and patch. This is BACKWARDS INCOMPATIBLE for anyone that has written a custom DjangoTestRunner class since it was introduced in r12255. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12487 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
2010-02-13Fixed #12825 -- Corrected a missing space in a test case error message. ↵Russell Keith-Magee
Thanks to timo for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12417 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-02Removed a stray debug statement. Thanks to Ramiro Morales for the report.Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12375 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-02-01Fixed #6364 -- Added the ability to run individual doctests.Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12364 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-28Fixed #12720 -- Corrected handling of cookies in the TestClient. Thanks to ↵Russell Keith-Magee
James Henstridge for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12343 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-25Fixed #12672 -- Added the ability to configure which applications are ↵Russell Keith-Magee
available on which database. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12290 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-25Fixed #12542 -- Added the TEST_MIRROR setting, allowing testing of read ↵Russell Keith-Magee
slave databases. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12289 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-22Fixed #12659 -- Return a more meaningful KeyError message when ContextList ↵Russell Keith-Magee
lookups fail. Thanks to rodriguealcazar for the suggestion. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12274 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-22Fixed #10314 -- Added a message prefix argument to Django's test assertions. ↵Russell Keith-Magee
Thanks to Wes Winham for the original suggestion, and Chistian Oudard for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12273 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-19Fixed #12640 -- Corrected a regression in test suite construction order ↵Russell Keith-Magee
introduced by #12255. Also updated the docs to reflect what the test code has always done. Thanks to Ramiro Morales for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12261 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-18Fixed #12624 -- Modified test runners to be class based.Russell Keith-Magee
git-svn-id: http://code.djangoproject.com/svn/django/trunk@12255 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2010-01-04Modified the way EMAIL_BACKEND is specified to make it consistent with the ↵Russell Keith-Magee
new "use the class name" policy for backends. This is a BACKWARDS-INCOMPATIBLE CHANGE for anyone using a manually specified EMAIL_BACKEND setting. If you have manually specified EMAIL_BACKEND, you will need to append ".EmailBackend" to your existing EMAIL_BACKEND setting. See the django-dev mailing list for details. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12084 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-31Ensure the default keyboard interrupt handler is restoredKaren Tracey
even if the test runner raises an exception. Thanks Alex Gaynor. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12036 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-31Fixed #12364: Added graceful exit from a test run when Ctrl-C is pressed. ↵Karen Tracey
Thanks Randy Barlow. git-svn-id: http://code.djangoproject.com/svn/django/trunk@12034 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-14Fixed #6262 -- Added a cached template loader, and modified existing ↵Russell Keith-Magee
template loaders and tag to be cacheable. Thanks to Mike Malone for the patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11862 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-12-13Fixed #11613: Added a failfast option for test running. Thanks jukvalim and ↵Karen Tracey
Randy Barlow. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11843 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-11-04Corrected the order of operations in the test environment setup to ensure ↵Russell Keith-Magee
that the original email backend can be restored. Thanks to koenb for the report. git-svn-id: http://code.djangoproject.com/svn/django/trunk@11718 bcc190cf-cafb-0310-a4f2-bffc1f526a37