def with_dummy_image(self): dummy_image = StringIO( 'GIF89a\x01\x00\x01\x00\x80\x00\x00\x00\x00\x00\x00\x00' '\x00!\xf9\x04\x04\x00\x00\x00\x00,\x00\x00\x00\x00\x01\x00' '\x01\x00\x00\x02\x02D\x01\x00;') dummy_image.filename = 'logo.png' dummy_image.contentType = 'image/png' dummy_image._height = '20px' dummy_image._width = '20px' self.arguments["image"] = dummy_image return self
PLONE_APP_CONTENTTYPES_FIXTURE, PLONE_APP_CONTENTTYPES_MIGRATION_FIXTURE) from plone.app.testing import PLONE_FIXTURE from plone.app.testing import TEST_USER_ID from plone.app.testing import TEST_USER_NAME from plone.app.testing import TEST_USER_PASSWORD from plone.app.testing import layers from plone.app.testing import login from plone.app.testing import ploneSite from plone.app.testing import setRoles from plone.testing import z2 from zope.configuration import xmlconfig B64_DATA = 'R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=' GIF = StringIO(decodestring(B64_DATA)) GIF.filename = 'sample.gif' GIF.contentType = 'image/gif' GIF._width = 1 GIF._height = 1 def create(container, type_name, **kwargs): """A easy helper method to create some content since we do not have plone.api in core. """ new_id = container.invokeFactory(type_name, **kwargs) content = container[new_id] # Archetypes specific code was taken from ``plone.api`` # Switch when api has been merged into core. if IBaseObject.providedBy(content):
from plone.app.contenttypes.testing import PLONE_APP_CONTENTTYPES_FIXTURE, PLONE_APP_CONTENTTYPES_MIGRATION_FIXTURE from plone.app.testing import PLONE_FIXTURE from plone.app.testing import TEST_USER_ID from plone.app.testing import TEST_USER_NAME from plone.app.testing import TEST_USER_PASSWORD from plone.app.testing import layers from plone.app.testing import login from plone.app.testing import ploneSite from plone.app.testing import setRoles from plone.testing import z2 from zope.configuration import xmlconfig B64_DATA = "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=" GIF = StringIO(decodestring(B64_DATA)) GIF.filename = "sample.gif" GIF.contentType = "image/gif" GIF._width = 1 GIF._height = 1 def create(container, type_name, **kwargs): """A easy helper method to create some content since we do not have plone.api in core. """ new_id = container.invokeFactory(type_name, **kwargs) content = container[new_id] # Archetypes specific code was taken from ``plone.api`` # Switch when api has been merged into core. if IBaseObject.providedBy(content):
from plone.app.testing import PLONE_FIXTURE from plone.app.testing import TEST_USER_ID from plone.app.testing import TEST_USER_NAME from plone.app.testing import TEST_USER_PASSWORD from plone.app.testing import applyProfile from plone.app.testing import layers from plone.app.testing import login from plone.app.testing import ploneSite from plone.app.testing import setRoles from plone.testing import z2 from zope.configuration import xmlconfig B64_DATA = 'R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=' GIF = StringIO(decodestring(B64_DATA)) GIF.filename = 'sample.gif' GIF.contentType = 'image/gif' GIF._width = 1 GIF._height = 1 def create(container, type_name, **kwargs): """A easy helper method to create some content since we do not have plone.api in core. """ new_id = container.invokeFactory(type_name, **kwargs) content = container[new_id] # Archetypes specific code was taken from ``plone.api`` # Switch when api has been merged into core. if IBaseObject.providedBy(content):