
June 26, 2007
9:50 p.m.
On 6/26/07, Christian Simms <christian.simms@gmail.com> wrote:
Looks like I mis-assumed your problem, sorry. In the setUp method in your tests, you should return a Deferred which fires when all your data is loaded. This can be a pain if you already organized your code into classes inheriting from twisted.application.service.Service which have startService/stopService calls. It's a pain because trial doesn't create an application object like running inside twistd does. So, in the case of writing unit tests for applications, you can abstract out your initialization code into a method, and then call that method directly in your setUp method.
OK - I will work on this and see if I can figure it out. Thanks for the tip. Brendon