Chris Withers wrote:
Hi (yet) again ;-)

class MyLayer:

  @classmethod
  def setUp(self):
    self.app = Testing.ZopeTestCase.Zope2.app()

  @classmethod
  def tearDown(self):
    Testing.ZopeTestCase.close()

Shrug! That will modify the class! "self" is the class here (it's convention to call it "cls" when using @classmethod).

class MyTests(TestCase):

  def setUp(self):
    self.savepoint = transaction.savepoint()
    self.app = makerequest(?.app)

  def tearDown(self):
    self.savepoint.rollback()

  ...

What do I put in place of the ? to get hold of the layer's app?

self.layer.app

_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to