Skip to content

Commit

Permalink
test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Apr 1, 2014
1 parent 3b3246e commit eb02c23
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 8 additions & 0 deletions plone/app/vocabularies/testing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
from Products.CMFPlone.utils import getFSVersionTuple
from plone.app.testing import IntegrationTesting
from plone.app.testing import PLONE_FIXTURE
from plone.app.testing import PloneSandboxLayer

PLONE5 = getFSVersionTuple()[0] >= 5


class PAVocabulariesLayer(PloneSandboxLayer):
defaultBases = (PLONE_FIXTURE,)
Expand All @@ -14,6 +17,11 @@ def setUpZope(self, app, configurationContext):
context=configurationContext
)

def setUpPloneSite(self, portal):
if not PLONE5:
self.applyProfile(portal, 'plone.app.event:default')
set_timezone(tz='UTC')


PAVocabularies_FIXTURE = PAVocabulariesLayer()
PAVocabularies_INTEGRATION_TESTING = IntegrationTesting(
Expand Down
5 changes: 3 additions & 2 deletions plone/app/vocabularies/tests/test_timezonevocabularies.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class TimezoneTest(unittest.TestCase):

def setUp(self):
self.portal = self.layer['portal']
reg = getUtility(IRegistry)

def test_timezone_vocabulary(self):
tzvocab = getUtility(IVocabularyFactory, 'plone.app.vocabularies.Timezones')
Expand All @@ -30,8 +31,8 @@ def test_available_timezones_vocabulary(self):
# this is for Plone 4.3
reg_key = 'plone.available_timezones'
if reg_key not in reg:
# else use 'plone.app.event.available_timezones'
reg_key = "plone.app.event.available_timezones"
# this works only for plone.app.event 2.0
return

# initially, all common zones are available in AvailableTimezones
common_zones_vocab = getUtility(
Expand Down

0 comments on commit eb02c23

Please sign in to comment.