This is a report of which changes I took from Luke's patch & which from mine as I worked towards blending them into one. The goals of this rewrite are to: * Have a clean API with "one right way to do it" where possible. * Provide clear benifit to the users, so they're encouraged to move forward. * Be mindful of the fact that we want these tests to easily ported to TG2. setup.py: * Install Requirements * Luke: added WebTest to install_requires * Ken added it to testtools & tgtesttools * Merged: Kept Ken's b/c testing's not part of the core. view/base.py: * When testing, add controller's result to the paste.testing. (WebTest captures this & attaches it to the response. * Luke: added it under 'namespace' key * Ken: added it under the 'raw' key * Merged: Kept Ken's because raw is more meaningful to users than namespace. testutil.py: * Add support for WebTest * Luke: * created TGWebTest, a subclass of unittest.TestCase. No mechanism for just getting the app (for those that think unittest has too much boilerplate). * created DBWebTest, which sets up both WebTest & the database. * Ken: * Made the tests more CP3 friendly. * Added mount & unmount functions. Deprecated reset_cp in favor of unmount. * Added start_server as a replacement for start_cp. * Added "go" function, a shortcut for creating a testapp & doing a get. * Converted BrowsingSession to use WebTest. * Merged: * Added make_wsgiapp, which returns a wsgi application from cherrypy * Added make_app, which returns a WebTest.TestApp instance from cherrypy * Kept Luke's TGWebTest, but made it use these base functions. * Left off DBWebTest for now, until I understand how it's used. * Kept Ken's attempt at making things CP3 friendly. It's not a current hot goal, but the number of lines are minimal & the tests have been a major sticking point. * Kept Ken's mount & unmount functions, but made mount simpler & fixed argument names. * Kept Ken's start_server, but dropped the ability to mount an app -- tg2 won't have the same concept of starting a server, so this is the wrong thing to overemphasize in tg1.1. * Moved Ken's automatic start_server logic from "go" to "mount". * Dropped Ken's "go" function. People should use either TGWebTest or make_app() * Kept Ken's changes to BrowsingSession. turbogears/tests/* * Modified to work with testutil as above. * Made better use of setup_module & teardown_module so that app can be mounted and server started a reasonable number of times. Some might complain that test isolation is reduced by this, but that's not a strong point - you don't stop your server after every request in production do you? Plus, the tests scream with this more practical (and more practiced) approach. * Used Ken's patches as a base (plus changes for the revised testutil) for test_catwalk, test_errorhandling, test_expose, test_view, test_testutil, test_sqlalchemy. They were more consistent with the style of the modules. * Used Luke's patches for test_paginate, test_controllers * In test_controllers, added some of Ken's stuff for handling return values from controllers instead of attaching them to 'self'. * Used a hybrid for test_form_controllers, test_identity * Just in case anyone's counting, test_controllers & test_paginate are the biggest test modules. 52 tests in the former, 34 in the later, out of a total of 185 tests in turbogears/tests (about half).