コード例 #1
0
class EmbedTileTestCase(TestTileMixin, unittest.TestCase):

    def setUp(self):
        super(EmbedTileTestCase, self).setUp()
        self.tile = EmbedTile(self.cover, self.request)
        self.tile.__name__ = u'collective.cover.embed'
        self.tile.id = u'test'

    @unittest.expectedFailure  # FIXME: raises BrokenImplementation
    def test_interface(self):
        self.interface = IEmbedTile
        self.klass = EmbedTile
        super(EmbedTileTestCase, self).test_interface()

    def test_default_configuration(self):
        self.assertTrue(self.tile.is_configurable)
        self.assertTrue(self.tile.is_editable)
        self.assertFalse(self.tile.is_droppable)

    def test_accepted_content_types(self):
        self.assertEqual(self.tile.accepted_ct(), [])

    def test_tile_is_empty(self):
        self.assertTrue(self.tile.is_empty())

    def test_render_empty(self):
        msg = u'Please edit the tile to add the code to be embedded.'

        self.tile.is_compose_mode = Mock(return_value=True)
        self.assertIn(msg, self.tile())

        self.tile.is_compose_mode = Mock(return_value=False)
        self.assertNotIn(msg, self.tile())
コード例 #2
0
 def setUp(self):
     self.portal = self.layer['portal']
     self.request = self.layer['request']
     self.cover = self.portal['frontpage']
     self.tile = EmbedTile(self.cover, self.request)
     # XXX: tile initialization
     self.tile.__name__ = 'collective.cover.embed'
コード例 #3
0
class EmbedTileTestCase(TestTileMixin, unittest.TestCase):
    def setUp(self):
        super(EmbedTileTestCase, self).setUp()
        self.tile = EmbedTile(self.cover, self.request)
        self.tile.__name__ = u'collective.cover.embed'
        self.tile.id = u'test'

    @unittest.expectedFailure  # FIXME: raises BrokenImplementation
    def test_interface(self):
        self.interface = IEmbedTile
        self.klass = EmbedTile
        super(EmbedTileTestCase, self).test_interface()

    def test_default_configuration(self):
        self.assertTrue(self.tile.is_configurable)
        self.assertTrue(self.tile.is_editable)
        self.assertFalse(self.tile.is_droppable)

    def test_accepted_content_types(self):
        self.assertEqual(self.tile.accepted_ct(), [])

    def test_tile_is_empty(self):
        self.assertTrue(self.tile.is_empty())

    def test_render_empty(self):
        msg = u'Please edit the tile to add the code to be embedded.'

        self.tile.is_compose_mode = Mock(return_value=True)
        self.assertIn(msg, self.tile())

        self.tile.is_compose_mode = Mock(return_value=False)
        self.assertNotIn(msg, self.tile())
コード例 #4
0
class EmbedTileTestCase(unittest.TestCase):

    layer = INTEGRATION_TESTING

    def setUp(self):
        self.portal = self.layer['portal']
        self.request = self.layer['request']
        self.cover = self.portal['frontpage']
        self.tile = EmbedTile(self.cover, self.request)
        # XXX: tile initialization
        self.tile.__name__ = 'collective.cover.embed'

    def test_interface(self):
        self.assertTrue(IPersistentCoverTile.implementedBy(EmbedTile))
        self.assertTrue(verifyClass(IPersistentCoverTile, EmbedTile))

        tile = EmbedTile(None, None)
        self.assertTrue(IPersistentCoverTile.providedBy(tile))
        self.assertTrue(verifyObject(IPersistentCoverTile, tile))

    def test_default_configuration(self):
        self.assertTrue(self.tile.is_configurable)
        self.assertTrue(self.tile.is_editable)
        self.assertFalse(self.tile.is_droppable)

    def test_tile_is_empty(self):
        self.assertTrue(self.tile.is_empty())

    def test_accepted_content_types(self):
        self.assertEqual(self.tile.accepted_ct(), [])

    def test_render_empty(self):
        msg = u'Please edit the tile to add the code to be embedded.'
        self.assertIn(msg, self.tile())
コード例 #5
0
    def test_interface(self):
        self.assertTrue(IPersistentCoverTile.implementedBy(EmbedTile))
        self.assertTrue(verifyClass(IPersistentCoverTile, EmbedTile))

        tile = EmbedTile(None, None)
        self.assertTrue(IPersistentCoverTile.providedBy(tile))
        self.assertTrue(verifyObject(IPersistentCoverTile, tile))
コード例 #6
0
class EmbedTileTestCase(unittest.TestCase):

    layer = INTEGRATION_TESTING

    def setUp(self):
        self.portal = self.layer['portal']
        self.request = self.layer['request']
        self.cover = self.portal['frontpage']
        self.tile = EmbedTile(self.cover, self.request)
        # XXX: tile initialization
        self.tile.__name__ = 'collective.cover.embed'

    def test_interface(self):
        self.assertTrue(IPersistentCoverTile.implementedBy(EmbedTile))
        self.assertTrue(verifyClass(IPersistentCoverTile, EmbedTile))

        tile = EmbedTile(None, None)
        self.assertTrue(IPersistentCoverTile.providedBy(tile))
        self.assertTrue(verifyObject(IPersistentCoverTile, tile))

    def test_default_configuration(self):
        self.assertTrue(self.tile.is_configurable)
        self.assertTrue(self.tile.is_editable)
        self.assertFalse(self.tile.is_droppable)

    def test_tile_is_empty(self):
        self.assertTrue(self.tile.is_empty())

    def test_render_empty(self):
        msg = "Please edit the tile to add the code to be embedded."
        self.assertTrue(msg in self.tile())
コード例 #7
0
 def setUp(self):
     self.portal = self.layer['portal']
     self.request = self.layer['request']
     self.cover = self.portal['frontpage']
     self.tile = EmbedTile(self.cover, self.request)
     # XXX: tile initialization
     self.tile.__name__ = 'collective.cover.embed'
コード例 #8
0
 def setUp(self):
     self.portal = self.layer["portal"]
     self.request = self.layer["request"]
     self.cover = self.portal["frontpage"]
     self.tile = EmbedTile(self.cover, self.request)
     # XXX: tile initialization
     self.tile.__name__ = "collective.cover.embed"
コード例 #9
0
class EmbedTileTestCase(unittest.TestCase):

    layer = INTEGRATION_TESTING

    def setUp(self):
        self.portal = self.layer["portal"]
        self.request = self.layer["request"]
        self.cover = self.portal["frontpage"]
        self.tile = EmbedTile(self.cover, self.request)
        # XXX: tile initialization
        self.tile.__name__ = "collective.cover.embed"

    def test_interface(self):
        self.assertTrue(IPersistentCoverTile.implementedBy(EmbedTile))
        self.assertTrue(verifyClass(IPersistentCoverTile, EmbedTile))

        tile = EmbedTile(None, None)
        self.assertTrue(IPersistentCoverTile.providedBy(tile))
        self.assertTrue(verifyObject(IPersistentCoverTile, tile))

    def test_default_configuration(self):
        self.assertTrue(self.tile.is_configurable)
        self.assertTrue(self.tile.is_editable)
        self.assertFalse(self.tile.is_droppable)

    def test_tile_is_empty(self):
        self.assertTrue(self.tile.is_empty())

    def test_render_empty(self):
        msg = "Please edit the tile to add the code to be embedded."
        self.assertTrue(msg in self.tile())
コード例 #10
0
 def setUp(self):
     super(EmbedTileTestCase, self).setUp()
     self.tile = EmbedTile(self.cover, self.request)
     self.tile.__name__ = u'collective.cover.embed'
     self.tile.id = u'test'
コード例 #11
0
 def setUp(self):
     super(EmbedTileTestCase, self).setUp()
     self.tile = EmbedTile(self.cover, self.request)
     self.tile.__name__ = u'collective.cover.embed'
     self.tile.id = u'test'
コード例 #12
0
 def setUp(self):
     self.portal = self.layer['portal']
     self.request = self.layer['request']
     self.cover = self.portal['frontpage']
     self.tile = EmbedTile(self.cover, self.request)