Commit Graph

132 Commits

Author SHA1 Message Date
Russell Keith-Magee ff60c5f9de Fixed #1142 -- Added multiple database support.
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-22 15:18:51 +00:00
Russell Keith-Magee 44b9076bbe Fixed #6262 -- Added a cached template loader, and modified existing 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-14 12:08:23 +00:00
Russell Keith-Magee b59aa81d68 Corrected the order of operations in the test environment setup to ensure 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
2009-11-04 10:31:37 +00:00
Russell Keith-Magee aba5389326 Fixed #10355 -- Added an API for pluggable e-mail backends.
Thanks to Andi Albrecht for his work on this patch, and to everyone else that contributed during design and development.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@11709 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-11-03 12:53:26 +00:00
Russell Keith-Magee ee2f04d79e Fixed #10482 -- Unified access to response.context when inspecting responses from the test client. Thanks to James Bennett for the design, and Julien Phalip for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10084 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-03-18 10:46:55 +00:00
Malcolm Tredinnick beb20057a3 Fixed #10165 -- Use settings.TEST_RUNNER in runtests.py
This permits running Django's core tests under an alternative test runner. Most
likely useful to non-CPython implementations, rather than much else (since
Django's core tests might assume things about the test runner).

Patch from Leo Soto.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@9918 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2009-02-28 04:46:38 +00:00
Russell Keith-Magee 9dc4ba875f Fixed #5461 -- Refactored the database backend code to use classes for the creation and introspection modules. Introduces a new validation module for DB-specific validation. This is a backwards incompatible change; see the wiki for details.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@8296 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-11 12:11:25 +00:00
Jacob Kaplan-Moss 34a3bd5225 Major refactoring of django.dispatch with an eye towards speed. The net result is that signals are up to 90% faster.
Though some attempts and backwards-compatibility were made, speed trumped compatibility. Thus, as usual, check BackwardsIncompatibleChanges for the complete list of backwards-incompatible changes.

Thanks to Jeremy Dunck and Keith Busell for the bulk of the work; some ideas from Brian Herring's previous work (refs #4561) were incorporated.

Documentation is, sigh, still forthcoming.

Fixes #6814 and #3951 (with the new dispatch_uid argument to connect).


git-svn-id: http://code.djangoproject.com/svn/django/trunk@8223 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-08-06 15:32:46 +00:00
Malcolm Tredinnick c681f4070c Removed the mysql_old backend. It smells bad and has no friends.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7949 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-18 17:38:53 +00:00
Russell Keith-Magee 1107e6b479 Fixed #7751 -- Added check to allow for the fact that autocommit can be a property, rather than a function on certain database backends. Thanks to Leo Soto for the fix.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@7940 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2008-07-17 13:24:05 +00:00
Malcolm Tredinnick 14ed0efec9 Fixed #6134 -- Allow an on-disk SQLite database to be used for tests, if required. Patch from jdetaeye.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@6930 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-12-17 08:50:50 +00:00
Malcolm Tredinnick 3ec6568e64 Modified the test harness to respect the LANGUAGE_CODE setting. Also changed
Django's own test runner to always use 'en' for LANGUAGE_CODE when testing
core. Fixed #4709


git-svn-id: http://code.djangoproject.com/svn/django/trunk@6583 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-10-21 17:26:32 +00:00
Adrian Holovaty b3912d3609 Changed backend create_test_db() and destroy_test_db() hooks NOT to take the backend as an argument, as the backend as an object is going away
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5981 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20 03:16:55 +00:00
Adrian Holovaty 221f99ed58 Refactored quote_name() to DatabaseOperations.quote_name(). Refs #5106
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5967 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-20 01:03:33 +00:00
Adrian Holovaty 49c438fd21 Changed django.test.utils.create_test_db to return the name of the test database that was created
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5910 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-16 22:46:00 +00:00
Russell Keith-Magee f4d4936abf Added a return value to the test frameworks TestSMTPConnection.send_messages, to match the real implementation. Thanks for the suggestion and fix, Michael <absoludity@gmail.com>.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5899 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-16 10:54:28 +00:00
Adrian Holovaty 01adbb55e6 Major refactoring of django.core.management -- it's now a package rather than a 1730-line single module. All django-admin/manage.py commands are now stored in separate modules. This is backwards-incompatible for people who used django.core.management functions directly
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5898 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-08-16 06:06:55 +00:00
Malcolm Tredinnick 386a4c610c Added support for database cache table in test database.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5766 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-26 22:59:34 +00:00
Russell Keith-Magee f7ef0a92da Fixed #4738 -- Modified the prompt that is displayed when a test database cannot be created. The existing prompt was misleading if the issue wasn't a pre-existing database. Thanks for the suggestion, John Shaffer <jshaffer2112@gmail.com>.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5732 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-07-20 14:42:57 +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 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 880e3cfaa6 Backed out the changes in [5482] for a bit whilst some more investigation into
side-effects is done. Refs #4565.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5511 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-22 07:15:04 +00:00
Malcolm Tredinnick bccb8897e6 Fixed #4565 -- Changed template rendering to use iterators, rather than
creating large strings, as much as possible. This is all backwards compatible.
Thanks, Brian Harring.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5482 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-06-17 07:11:37 +00:00
Malcolm Tredinnick 0c4385bb02 Added new TEST_DATABASE_CHARSET and TEST_DATABASE_COLLATION settings to ensure
that databases are created with the expected encoding during testing.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5380 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-05-29 12:42:08 +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
Russell Keith-Magee fb509ee8d3 Fixed #2916 -- Moved syncdb call out of simple test runner and into create_test_db, to match documentation and simplify testing process for people using other test frameworks. Thanks, remco@diji.biz.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@4541 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2007-02-18 08:07:18 +00:00
Russell Keith-Magee 6f87b17a0d Fixes #2658 -- Modified SQLite cursor close() method for in-memory databases, making the lifespan of an in-memory database equal to the life of the process, rather than the life of the cursor. Thanks, Ned Batchelder.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3723 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-05 13:32:08 +00:00
Russell Keith-Magee d043200077 Refs #2333 - Re-added the template rendering signal for testing purposes; however, the signal is not available during normal operation. It is only added as part of an instrumentation step that occurs during test framework setup. Previous attempt (r3659) was reverted (r3666) due to performance concerns.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3707 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-02 09:26:24 +00:00
Russell Keith-Magee d78e2ae355 Refs #2333 - Added a TEST_DATABASE_NAME setting that can be used to override the 'test_' + DATABASE_NAME naming policy. This setting is then used in runtests.py to restore the use of 'django_test_db' as the Django model/regression test database. Thanks to Michael Radziej for the feedback.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3706 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-09-01 13:33:26 +00:00
Russell Keith-Magee fc2d5f461f Refs #2333 - Added more documentation for testing framework, and clarified some code as a result of trying to describe it.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3689 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-31 14:29:47 +00:00
Jacob Kaplan-Moss 56264160a2 Test database creation/deletion now correctly quotes database names when creating/dropping them.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3673 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-28 18:59:54 +00:00
Russell Keith-Magee 7dce86ce02 Refs #2333 - Added test framework. This includes doctest and unittest finders, Django-specific doctest and unittest wrappers, and a pseudo-client that can be used to stimulate and test views.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3658 bcc190cf-cafb-0310-a4f2-bffc1f526a37
2006-08-27 12:24:59 +00:00