Skip to content

Commit

Permalink
- In test-setup, explicitly install DateRecurringIndex instead of ext…
Browse files Browse the repository at this point in the history
…ending

  it's test layer fixture. This should finally fix #81, where other tests
  couldn't be run when not extending the DRI or PAE test fixture layers.
  • Loading branch information
thet committed Sep 9, 2013
1 parent 32e9aa4 commit 2e87d1f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Expand Up @@ -4,6 +4,11 @@ Changelog
1.0dev (unreleased)
-------------------

- In test-setup, explicitly install DateRecurringIndex instead of extending
it's test layer fixture. This should finally fix #81, where other tests
couldn't be run when not extending the DRI or PAE test fixture layers.
[thet]

- Support the @@images view for IOccurrence objects by using a factory, which
returns a AT or DX specific view depending on the Occurrence's parent.
[thet]
Expand Down
10 changes: 8 additions & 2 deletions plone/app/event/testing.py
@@ -1,4 +1,3 @@
from Products.DateRecurringIndex.testing import DRI_FIXTURE
from plone.app.event.interfaces import IBrowserLayer
from plone.app.event.interfaces import IEventSettings
from plone.app.testing import IntegrationTesting
Expand Down Expand Up @@ -43,12 +42,15 @@ def os_zone():


class PAEventLayer(PloneSandboxLayer):
defaultBases = (DRI_FIXTURE, PLONE_FIXTURE,)
defaultBases = (PLONE_FIXTURE,)

def setUpZope(self, app, configurationContext):
# store original TZ, for the case it's overwritten
self.ostz = os_zone()

# Install products that use an old-style initialize() function
z2.installProduct(app, 'Products.DateRecurringIndex')

# Load ZCML
import plone.app.event
self.loadZCML(package=plone.app.event, context=configurationContext)
Expand All @@ -58,12 +60,16 @@ def setUpPloneSite(self, portal):
set_timezone(tz='UTC')

def tearDownZope(self, app):
# Uninstall old-style Products
z2.uninstallProduct(app, 'Products.DateRecurringIndex')

# reset OS TZ
if self.ostz:
os.environ['TZ'] = self.ostz
elif 'TZ' in os.environ:
del os.environ['TZ']


PAEvent_FIXTURE = PAEventLayer()
PAEvent_INTEGRATION_TESTING = IntegrationTesting(
bases=(PAEvent_FIXTURE,),
Expand Down

1 comment on commit 2e87d1f

@mister-roboto
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing information:

Please sign in to comment.