Skip to content

Commit

Permalink
remove layer and manually push/pop global registry
Browse files Browse the repository at this point in the history
  • Loading branch information
petschki committed Oct 9, 2018
1 parent e3df908 commit 1f62e84
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions archetypes/schemaextender/tests/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from archetypes.schemaextender.extender import instanceSchemaFactory
from archetypes.schemaextender.interfaces import IExtensible
from plone.app.testing import helpers
from plone.app.testing.bbb_at import PloneTestCase
from plone.testing import zca
from Products.Archetypes.public import BaseObject
Expand All @@ -11,8 +12,16 @@


class ASTestCase(PloneTestCase):
""" Base class for testing archetypes.schemaextender """
layer = zca.UNIT_TESTING
""" Base class for testing archetypes.schemaextender
we manually push and pop global registry here to avoid
leaking extended fields into other testcases
"""

def beforeSetUp(self):
helpers.pushGlobalRegistry(self.layer['portal'])

def afterTearDown(self):
helpers.popGlobalRegistry(self.layer['portal'])


@implementer(IExtensible)
Expand Down

0 comments on commit 1f62e84

Please sign in to comment.