[1214] | 1 | # -*- coding: utf-8 -*- |
---|
| 2 | from Products.Five import zcml |
---|
| 3 | from Products.Five import fiveconfigure |
---|
| 4 | from Testing import ZopeTestCase as ztc |
---|
| 5 | from Products.PloneTestCase import PloneTestCase as ptc |
---|
| 6 | from Products.PloneTestCase.layer import onsetup |
---|
| 7 | |
---|
| 8 | ZOPE_DEPS = [] |
---|
[1239] | 9 | |
---|
| 10 | try: |
---|
| 11 | import quintagroup.plonecomments |
---|
| 12 | except ImportError: |
---|
| 13 | QPC_PACKAGE = False |
---|
| 14 | from Products import qPloneComments |
---|
| 15 | else: |
---|
| 16 | QPC_PACKAGE = True |
---|
| 17 | |
---|
[1214] | 18 | PLONE_INSTALL = ['QuillsEnabled', 'AutocompleteWidget', |
---|
| 19 | 'quintagroup.plonecomments', 'quintagroup.quills.extras'] |
---|
| 20 | PLONE_DEPS = ['QuillsEnabled', 'AutocompleteWidget'] |
---|
| 21 | |
---|
[1239] | 22 | if QPC_PACKAGE: |
---|
| 23 | PLONE_INSTALL += ['quintagroup.plonecomments',] |
---|
| 24 | else: |
---|
| 25 | PLONE_INSTALL += ['qPloneComments',] |
---|
| 26 | PLONE_DEPS += ['qPloneComments',] |
---|
| 27 | |
---|
[1214] | 28 | @onsetup |
---|
| 29 | def setup_quillsextras_policy(): |
---|
| 30 | """The @onsetup decorator causes the execution of this body to be deferred |
---|
| 31 | until the setup of the Plone site testing layer. |
---|
| 32 | """ |
---|
| 33 | # Load the ZCML configuration for the quintagroup.quills.extras package |
---|
| 34 | # and its dependencies |
---|
| 35 | fiveconfigure.debug_mode = True |
---|
| 36 | import quintagroup.quills.extras |
---|
| 37 | zcml.load_config('configure.zcml', quintagroup.quills.extras) |
---|
| 38 | zcml.load_config('overrides.zcml', quintagroup.quills.extras) |
---|
[1239] | 39 | if QPC_PACKAGE: |
---|
| 40 | import quintagroup.plonecomments |
---|
| 41 | zcml.load_config('configure.zcml', quintagroup.plonecomments) |
---|
| 42 | zcml.load_config('overrides.zcml', quintagroup.plonecomments) |
---|
| 43 | ztc.installPackage('quintagroup.plonecomments') |
---|
| 44 | |
---|
[1214] | 45 | fiveconfigure.debug_mode = False |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | for p in PLONE_INSTALL: |
---|
| 49 | ztc.installProduct(p) |
---|
| 50 | |
---|
| 51 | setup_quillsextras_policy() |
---|
| 52 | ptc.setupPloneSite(products=PLONE_INSTALL) |
---|
[1239] | 53 | |
---|
| 54 | import patches |
---|