[Product-Developers] Testing collective.contentleadimage

Tom Gross itconsense at gmail.com
Thu Aug 4 10:26:18 UTC 2011


Ok, I found the issue myself. Blobs in Demostorage are supported ZODB >= 
3.9.0. I'm using Plone 3.3 with ZODB 3.8.6 (with blobs obviously ;)

For the records. I'm now installing the product at a later time. Like this:

class MyProductTestCase(ptc.PloneTestCase):
     """ A test case for MyProduct """

     def afterSetUp(self):
         self.setRoles(['Manager'])
         gs_tool = self.portal['portal_setup']
 
gs_tool.runAllImportStepsFromProfile('profile-Products.MyProduct:default',
                                              ignore_dependencies=True)

# good dependencies ...
PROFILES = ['Products.ATVocabularyManager:default',]

ptc.setupPloneSite(extension_profiles=PROFILES)


Thanks and cheers
-Tom

On 08/04/2011 11:56 AM, Tom Gross wrote:
> Hi
>
> I have written a product which depends on collective.contentleadimage
> via a genericsetup dependency. Running the unittests of my product gives
> the following error:
>
> Traceback (most recent call last):
> File
> "/home/tom/workspace/eggs/zope.testing-3.8.3-py2.4.egg/zope/testing/testrunner/runner.py",
> line 364, in run_layer
> setup_layer(options, layer, setup_layers)
> File
> "/home/tom/workspace/eggs/zope.testing-3.8.3-py2.4.egg/zope/testing/testrunner/runner.py",
> line 629, in setup_layer
> layer.setUp()
> File
> "/home/tom/workspace/eggs/Products.PloneTestCase-0.9.13-py2.4.egg/Products/PloneTestCase/layer.py",
> line 33, in setUp
> func(*args, **kw)
> File
> "/home/tom/workspace/eggs/Products.PloneTestCase-0.9.13-py2.4.egg/Products/PloneTestCase/setup.py",
> line 169, in setupPloneSite
> base_profile, extension_profiles).run()
> File
> "/home/tom/workspace/eggs/Products.PloneTestCase-0.9.13-py2.4.egg/Products/PloneTestCase/setup.py",
> line 220, in run
> self._setupHomeFolder()
> File
> "/home/tom/workspace/eggs/Products.PloneTestCase-0.9.13-py2.4.egg/Products/PloneTestCase/setup.py",
> line 326, in _setupHomeFolder
> self._commit()
> File
> "/home/tom/workspace/eggs/Products.PloneTestCase-0.9.13-py2.4.egg/Products/PloneTestCase/setup.py",
> line 369, in _commit
> transaction.commit()
> File
> "/home/tom/workspace/eggs/ZODB3-3.8.6-py2.4-linux-x86_64.egg/transaction/_manager.py",
> line 93, in commit
> return self.get().commit()
> File
> "/home/tom/workspace/eggs/ZODB3-3.8.6-py2.4-linux-x86_64.egg/transaction/_transaction.py",
> line 325, in commit
> self._commitResources()
> File
> "/home/tom/workspace/eggs/ZODB3-3.8.6-py2.4-linux-x86_64.egg/transaction/_transaction.py",
> line 424, in _commitResources
> rm.commit(self)
> File
> "/home/tom/workspace/eggs/ZODB3-3.8.6-py2.4-linux-x86_64.egg/ZODB/Connection.py",
> line 545, in commit
> self._commit(transaction)
> File
> "/home/tom/workspace/eggs/ZODB3-3.8.6-py2.4-linux-x86_64.egg/ZODB/Connection.py",
> line 590, in _commit
> self._store_objects(ObjectWriter(obj), transaction)
> File
> "/home/tom/workspace/eggs/ZODB3-3.8.6-py2.4-linux-x86_64.egg/ZODB/Connection.py",
> line 628, in _store_objects
> raise Unsupported(
> Unsupported: Storing Blobs in <ZODB.DemoStorage.DemoStorage instance at
> 0x27f2a28> is not supported.
>
> Uncommenting the dependency works as expected. Is there
>
> a) a way of disabeling the Blob-storage of collective.contentleadimage
> while unittesting
>
> or
>
> b) a way to conditionally include a dependency via generic setup
>
> or
>
> c) a solution a haven't thought of?
>
> Thanks
> -Tom
>
>
>


-- 
Author of the book "Plone 3 Multimedia" - http://amzn.to/dtrp0C

Tom Gross
email..........tom at toms-projekte.de
skype.....................tom_gross
web.........http://toms-projekte.de
blog...http://blog.toms-projekte.de



More information about the Product-Developers mailing list