コード例 #1
0
ファイル: ERP5TypeTestCase.py プロジェクト: esosaja/erp5
 def _restoreMailHost(self):
   """Restore original Mail Host
   """
   cls = self.portal.MailHost.__class__
   if cls.__bases__[0] is DummyMailHostMixin:
     cls.__bases__ = cls.__bases__[1:]
     pmc_init_of(cls)
コード例 #2
0
ファイル: ERP5TypeTestCase.py プロジェクト: esosaja/erp5
 def _setUpDummyMailHost(self):
   """Replace Original Mail Host by Dummy Mail Host in a non-persistent way
   """
   cls = self.portal.MailHost.__class__
   if not issubclass(cls, DummyMailHostMixin):
     cls.__bases__ = (DummyMailHostMixin,) + cls.__bases__
     pmc_init_of(cls)
コード例 #3
0
ファイル: lazy_class.py プロジェクト: dwtcourses/erp5
    def resetAcquisition(cls):
        # First, fill the __get__ slot of the class
        # that has been null'ed after resetting its __bases__
        # This descriptor is the magic allowing __of__ and our
        # _aq_dynamic trick
        pmc_init_of(cls)

        # And we need to do the same thing on subclasses
        for subclass in PortalTypeMetaClass.getSubclassList(cls):
            pmc_init_of(subclass)
コード例 #4
0
ファイル: lazy_class.py プロジェクト: Provab-Solutions/erp5
  def resetAcquisition(cls):
    # First, fill the __get__ slot of the class
    # that has been null'ed after resetting its __bases__
    # This descriptor is the magic allowing __of__ and our
    # _aq_dynamic trick
    pmc_init_of(cls)

    # And we need to do the same thing on subclasses
    for subclass in PortalTypeMetaClass.getSubclassList(cls):
      pmc_init_of(subclass)
コード例 #5
0
def setupDummyMailHost(self):
  """Replace Original Mail Host by Dummy Mail Host in a non-persistent way

  Copied & pasted from ERP5TypeTestCaseMixin._setUpDummyMailHost
  """
  cls = self.getPortalObject().portal.MailHost.__class__
  if not issubclass(cls, DummyMailHostMixin):
    cls.__bases__ = (DummyMailHostMixin,) + cls.__bases__
    pmc_init_of(cls)
  return True
コード例 #6
0
def setupDummyMailHost(self):
    """Replace Original Mail Host by Dummy Mail Host in a non-persistent way

  Copied & pasted from ERP5TypeTestCaseMixin._setUpDummyMailHost
  """
    cls = self.getPortalObject().MailHost.__class__
    if not issubclass(cls, DummyMailHostMixin):
        cls.__bases__ = (DummyMailHostMixin, ) + cls.__bases__
        pmc_init_of(cls)
    return True
コード例 #7
0
def setupDummyMailHost(self):
  """Replace Original Mail Host by Dummy Mail Host in a non-persistent way
  and reset the list of already sent messages.

  Copied & pasted from ERP5TypeTestCaseMixin._setUpDummyMailHost
  """
  mailhost = self.getPortalObject().MailHost
  cls = mailhost.__class__
  if not issubclass(cls, DummyMailHostMixin):
    cls.__bases__ = (DummyMailHostMixin,) + cls.__bases__
    pmc_init_of(cls)
  mailhost.reset()
  return True