On Jun 14, 2009, at 5:41 AM, Andreas Jung wrote:
The current test code looks like this:

PloneTestCase.installProduct('vs.event')
PloneTestCase.setupPloneSite(extension_profiles=('vs.event:default',))

@onsetup
def setup_package():

 ZopeTestCase.installPackage('vs.event')
 zcml.load_config('configure.zcml', vs.event)

setup_package()

class TestBase(PloneTestCase.FunctionalTestCase):

   def afterSetUp(self):
       ZopeTestCase.utils.setupCoreSessions(self.app)
#        zcml.load_config('configure.zcml', vs.event)
       self.membership = self.portal.portal_membership
       self.membership.addMember('god', 'secret', ['Manager'], [])

class VSEventTest(TestBase):

   def testCalendarToolCheck(self):
       pc = self.portal.portal_calendar
       self.assertEqual(pc.meta_type, 'Chronos Calendar Tool')


You need to move your installProduct/setupPloneSite calls to be after the setup_package() call; otherwise your product's ZCML hasn't loaded. You might also need to move the ztc.installPackage call below the zcml.load_config call.

I always refer to Martin's example test setup in PPD; it has worked consistently for me when using roadrunner.

David Glick
Web Developer
ONE/Northwest

New tools and strategies for engaging people in protecting the environment

http://www.onenw.org
[email protected]
work: (206) 286-1235 x32
mobile: (206) 679-3833

Subscribe to ONEList, our email newsletter!
Practical advice for effective online engagement
http://www.onenw.org/full_signup





_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to