Skip to content

Commit

Permalink
Merge 2e7d996 into decfa62
Browse files Browse the repository at this point in the history
  • Loading branch information
pysailor committed Sep 24, 2014
2 parents decfa62 + 2e7d996 commit 1968afa
Show file tree
Hide file tree
Showing 9 changed files with 354 additions and 9 deletions.
11 changes: 10 additions & 1 deletion CHANGES.rst
Expand Up @@ -4,8 +4,17 @@ Changelog
1.2 (unreleased)
----------------

- Nothing changed yet.
- fix error with copy & paste for dx image types #52
[pysailor]

- do not include testing.zcml automatically and use the behavior for the
testing-dx-type.

ATTENTION: we no longer provide the cropping maker interface for
``plone.dexterity.content.DexterityContent`` automatically, please use
``plone.app.imagecropping.behaviors.IImageCroppingBehavior`` to enable
cropping for your dexterity types.
[fRiSi]

1.1 (2014-09-13)
----------------
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -44,6 +44,7 @@
],
extras_require={
'test': [
'Products.DateRecurringIndex',
'plone.app.testing[robot]>=4.2.2',
'plone.app.robotframework',
'plone.app.contenttypes',
Expand Down
1 change: 0 additions & 1 deletion src/plone/app/imagecropping/configure.zcml
Expand Up @@ -11,7 +11,6 @@
<i18n:registerTranslations directory="locales" />
<include package=".browser" />
<include package=".upgrades" />
<include file="testing.zcml" />

<genericsetup:registerProfile
name="default"
Expand Down
2 changes: 2 additions & 0 deletions src/plone/app/imagecropping/dx.py
Expand Up @@ -33,6 +33,8 @@ def __init__(self, context):

def _all_fields(self):
type_info = self.context.getTypeInfo()
if type_info is None:
return
schema = type_info.lookupSchema()
for field in getFieldsInOrder(schema):
yield field
Expand Down
Expand Up @@ -26,6 +26,7 @@
<property name="behaviors">
<element value="plone.app.dexterity.behaviors.metadata.IDublinCore"/>
<element value="plone.app.content.interfaces.INameFromTitle"/>
<element value="plone.app.imagecropping.behaviors.IImageCroppingBehavior"/>
</property>
<property name="schema"></property>
<property
Expand Down
44 changes: 44 additions & 0 deletions src/plone/app/imagecropping/testing.py
Expand Up @@ -40,13 +40,57 @@ def setUpPloneSite(self, portal):
)


class PloneAppImagecroppingDX(PloneSandboxLayer):

defaultBases = (PLONE_FIXTURE,)

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

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

def setUpPloneSite(self, portal):
applyProfile(portal, 'plone.app.contenttypes:default')
applyProfile(portal, 'plone.app.imagecropping:testing')
portal.acl_users.userFolderAddUser('admin',
'secret',
['Manager'],
[])
login(portal, 'admin')
portal.portal_workflow.setDefaultChain('one_state_workflow')
setRoles(portal, TEST_USER_ID, ['Manager'])
portal.invokeFactory(
'Folder',
id='acceptance-test-folder',
title=u'Test Folder'
)


PLONE_APP_IMAGECROPPING = PloneAppImagecropping()
PLONE_APP_IMAGECROPPING_INTEGRATION = IntegrationTesting(
bases=(PLONE_APP_IMAGECROPPING, ),
name='plone.app.imagecropping:Integration')
PLONE_APP_IMAGECROPPING_FUNCTIONAL = FunctionalTesting(
bases=(PLONE_APP_IMAGECROPPING, ),
name='plone.app.imagecropping:Functional')
PLONE_APP_IMAGECROPPING_DX = PloneAppImagecroppingDX()
PLONE_APP_IMAGECROPPING_INTEGRATION_DX = IntegrationTesting(
bases=(PLONE_APP_IMAGECROPPING_DX, ),
name='plone.app.imagecropping:Integration_DX')
PLONE_APP_IMAGECROPPING_FUNCTIONAL_DX = FunctionalTesting(
bases=(PLONE_APP_IMAGECROPPING_DX, ),
name='plone.app.imagecropping:Functional_DX')
PLONE_APP_IMAGECROPPING_ROBOT = FunctionalTesting(
bases=(
AUTOLOGIN_LIBRARY_FIXTURE,
Expand Down
6 changes: 0 additions & 6 deletions src/plone/app/imagecropping/testing.zcml
Expand Up @@ -13,10 +13,4 @@
provides="Products.GenericSetup.interfaces.EXTENSION"
/>

<!-- Note: This provides cropping functionality for our contenttype
created through the testing profile. -->
<class class="plone.dexterity.content.DexterityContent">
<implements interface="plone.app.imagecropping.dx.IImageCroppingDX" />
</class>

</configure>
2 changes: 1 addition & 1 deletion src/plone/app/imagecropping/tests/test_cropping.py
Expand Up @@ -11,7 +11,7 @@
import unittest


class TestExample(unittest.TestCase):
class TestCroppingAT(unittest.TestCase):

layer = PLONE_APP_IMAGECROPPING_INTEGRATION

Expand Down

0 comments on commit 1968afa

Please sign in to comment.