Example #1
0
    def test_customize_product_name(self):
        self.load_zcml_string('\n'.join((
                    '<configure xmlns:inflator="http://namespaces.zope.org/inflator"'
                    '           i18n_domain="my.package">',
                    '    <inflator:customize',
                    '        product="my product" />',
                    '</configure>'
                    )))

        self.assertEquals(get_merged_customizations().product, u'my product')
Example #2
0
    def test_customize_image(self):
        self.load_zcml_string('\n'.join((
                    '<configure xmlns:inflator="http://namespaces.zope.org/inflator"'
                    '           i18n_domain="my.package"'
                    '           package="ftw.inflator.tests">',
                    '    <inflator:customize',
                    '        image="../resources/plone-logo.png" />',
                    '</configure>'
                    )))

        image = get_merged_customizations().image
        self.assertEquals(image, '++resource++inflator-plone-logo-10.png')

        with z2.zopeApp() as app:
            self.assertTrue(app.unrestrictedTraverse(image))
Example #3
0
    def test_merging_cusetomizations(self):
        self.load_zcml_string('\n'.join((
                    '<configure xmlns:inflator="http://namespaces.zope.org/inflator"'
                    '           i18n_domain="my.package"'
                    '           package="ftw.inflator.tests">',

                    '    <inflator:customize',
                    '        product="foo"'
                    '        image="../resources/plone-logo.png"'
                    '        order="4"/>',

                    '    <inflator:customize',
                    '        product="bar"'
                    '        order="5"/>',

                    '</configure>'
                    )))

        customizations = get_merged_customizations()
        self.assertEquals(customizations.image, '++resource++inflator-plone-logo-4.png')
        self.assertEquals(customizations.product, 'bar')
Example #4
0
 def get_customization(self):
     return get_merged_customizations()
Example #5
0
 def get_bundle_title(self):
     customization = get_merged_customizations()
     return _(u'Create a new ${product} site',
              mapping={'product': customization.product})
Example #6
0
 def get_bundle_title(self):
     customization = get_merged_customizations()
     return _(u"Create a new ${product} site", mapping={"product": customization.product})
Example #7
0
 def test_defaults(self):
     customizations = get_merged_customizations()
     self.assertEquals(customizations.image, '++resource++inflator-plone-logo-0.png')
     self.assertEquals(customizations.product, 'Plone')
Example #8
0
 def get_customization(self):
     return get_merged_customizations()
Example #9
0
 def get_bundle_title(self):
     customization = get_merged_customizations()
     return _(u'Create a new ${product} site',
              mapping={'product': customization.product})