Skip to content

Commit

Permalink
Merge pull request #58 from collective/issue_57
Browse files Browse the repository at this point in the history
Bring back compatibility with Plone 4.2
  • Loading branch information
saily committed Oct 2, 2014
2 parents dee8cd7 + 0c6d089 commit d83a57f
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 28 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Expand Up @@ -4,6 +4,9 @@ Changelog
1.2 (unreleased)
----------------

- Remove hard dependency on plone.app.contenttypes to avoid compatibility issues with Plone 4.2 (fixes `#57`_).
[hvelarde]

- Update package dependencies.
[hvelarde]

Expand Down Expand Up @@ -185,3 +188,5 @@ Changelog
[petschki]
- Package created using templer
[fRiSi]

.. _`#57`: https://github.com/collective/collective.cover/issues/57
1 change: 0 additions & 1 deletion setup.py
Expand Up @@ -59,7 +59,6 @@
extras_require={
'test': [
'AccessControl',
'plone.app.contenttypes',
'plone.app.dexterity',
'plone.app.robotframework',
'plone.app.testing[robot]>=4.2.2',
Expand Down
2 changes: 2 additions & 0 deletions src/plone/app/imagecropping/configure.zcml
Expand Up @@ -87,6 +87,8 @@
<!-- dexterity specific -->
<configure zcml:condition="installed plone.dexterity">

<include package="plone.behavior" file="meta.zcml" />

<!-- dexterity cropping adapter -->
<adapter factory=".dx.CroppingUtilsDexterity" />

Expand Down
35 changes: 17 additions & 18 deletions src/plone/app/imagecropping/testing.py
Expand Up @@ -9,7 +9,15 @@
from plone.app.testing import login
from plone.app.testing import setRoles
from plone.testing import z2
from zope.configuration import xmlconfig

import pkg_resources

try:
pkg_resources.get_distribution('plone.app.contenttypes')
except pkg_resources.DistributionNotFound:
HAS_DEXTERITY_CONTENTTYPES = False
else:
HAS_DEXTERITY_CONTENTTYPES = True


class PloneAppImagecropping(PloneSandboxLayer):
Expand All @@ -18,11 +26,7 @@ class PloneAppImagecropping(PloneSandboxLayer):

def setUpZope(self, app, configurationContext):
import plone.app.imagecropping
xmlconfig.file(
'testing.zcml',
plone.app.imagecropping,
context=configurationContext
)
self.loadZCML('testing.zcml', package=plone.app.imagecropping)

def setUpPloneSite(self, portal):
applyProfile(portal, 'plone.app.imagecropping:testing')
Expand All @@ -46,22 +50,17 @@ class PloneAppImagecroppingDX(PloneSandboxLayer):

def setUpZope(self, app, configurationContext):
z2.installProduct(app, 'Products.DateRecurringIndex')
import plone.app.contenttypes
xmlconfig.file(
'configure.zcml',
plone.app.contenttypes,
context=configurationContext
)
if HAS_DEXTERITY_CONTENTTYPES:
import plone.app.contenttypes
self.loadZCML(package=plone.app.contenttypes)

import plone.app.imagecropping
xmlconfig.file(
'testing.zcml',
plone.app.imagecropping,
context=configurationContext
)
self.loadZCML('testing.zcml', package=plone.app.imagecropping)

def setUpPloneSite(self, portal):
applyProfile(portal, 'plone.app.contenttypes:default')
if HAS_DEXTERITY_CONTENTTYPES:
applyProfile(portal, 'plone.app.contenttypes:default')

applyProfile(portal, 'plone.app.imagecropping:testing')
portal.acl_users.userFolderAddUser('admin',
'secret',
Expand Down
2 changes: 2 additions & 0 deletions src/plone/app/imagecropping/testing.zcml
Expand Up @@ -5,6 +5,8 @@

<include file="configure.zcml" />

<include package="plone.app.dexterity" />

<genericsetup:registerProfile
name="testing"
title="plone.app.imagecropping tests"
Expand Down
11 changes: 2 additions & 9 deletions test-4.2.cfg
Expand Up @@ -4,15 +4,8 @@ package-name = plone.app.imagecropping
package-extras = [archetypes, test]
plone-series = 4.2

[test]
defaults = ['-s', '${buildout:package-name}', '--auto-color', '--auto-progress', '--layer=!Integration_DX']

[versions]
plone.app.contenttypes = 1.0
plone.app.dexterity = 2.0.11
plone.app.event = 1.1b1
plone.app.portlets = 2.5.1
plone.app.z3cform = 0.7.2
plone.dexterity = 2.2.1
plone.namedfile = 2.0.5
plone.schemaeditor = 1.3.5
z3c.form = 3.2.1
AccessControl = 3.0.9
1 change: 1 addition & 0 deletions test-4.3.cfg
Expand Up @@ -2,6 +2,7 @@
extends = https://raw.github.com/collective/buildout.plonetest/master/test-4.3.x.cfg
package-name = plone.app.imagecropping
package-extras = [test]
test-eggs = plone.app.contenttypes
plone-series = 4.3


Expand Down
1 change: 1 addition & 0 deletions test-5.0.cfg
Expand Up @@ -2,4 +2,5 @@
extends = https://raw.github.com/collective/buildout.plonetest/master/test-5.0.x.cfg
package-name = plone.app.imagecropping
package-extras = [test]
test-eggs = plone.app.contenttypes
plone-series = 5.0

0 comments on commit d83a57f

Please sign in to comment.