On Fri, Jan 16, 2009 at 11:00 AM, Tim Black <[email protected]> wrote:
> Jorge Vargas wrote:
>
> On Thu, Jan 15, 2009 at 3:46 PM, Tim Black <[email protected]> wrote:
>
>
> migrateTests
>
>
> not sure what you mean but the testing framework from tg1.x was
> migrated to tg2, and of course more things where added, that said it
> should work.
>
> The code changes I have in mind are described here:
> http://docs.turbogears.org/1.1/TestMigration#id8 as follows:
>
>> Ian Bicking's WebTest has been selected as the best tool for this purpose,
>> and is being introduced in the TG 1.1 series.
>>
>> In order to support this move, several functions in testutil have been
>> deprecated in favor of the the new methodology. You can continue to run your
>> tests unchanged for now, but you will receive DeprecationWarnings. The
>> deprecated features will be removed in the next version of TurboGears, 1.5.
>
> I also have in mind the code changes described here:
> http://docs.turbogears.org/1.1/TestMigration#id10
>
those two bits could be somehow scriptable, yet a find & replace thing
could also do it.

> Jorge Vargas wrote:
>> As with everything if your app is well covered with tests migration should
>> be a lot simpler.
> Agreed.  Regrettably, I'm just starting to write unit tests for my TG 1.0
> application, and in the process discovered that it's "not...eas[y]" to test
> my application's controllers which are hidden behind identity decorators.
> But I'll try testutil.set_identity_user.
> Tim

yes indeed that's a bit weird (this is one of the things that push the
testing), it has been greatly improved in TG2 you simply add a
self.app.request('/login?<credentials>') and your good to go.
Another interesting fact of TG2 testing is the "full stack test stuff"
which you can reuse for your app if it's complex enough :)

oh and it's way more elegant :) not to mention you can so
response.xml, response.json, response.lxml and i forgot what else.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to