def testKnownScale(self): context = MockContext() context.field = MockField() traverser = ImageTraverser(context, None) self.failUnless( traverser.publishTraverse(None, 'field_mini') is data_marker)
def testCorrectFieldType(self): context = MockContext() context.field = MockField() traverser = ImageTraverser(context, None) self.failUnless( traverser.publishTraverse(None, 'field') is data_marker)
def testUnknownScale(self): context = MockContext() context.field = MockField() traverser = ImageTraverser(context, None) self.failUnless( traverser.publishTraverse(None, 'field_poster') is fallback_marker)
def testUnknownField(self): traverser = ImageTraverser(MockContext(), None) self.failUnless( traverser.publishTraverse(None, 'missing') is fallback_marker)
def testWrongFieldType(self): context = MockContext() context.field = BaseMockField() traverser = ImageTraverser(context, None) self.failUnless( traverser.publishTraverse(None, 'field') is fallback_marker)
def testKnownScale(self): context = MockContext() context.field = MockField() traverser = ImageTraverser(context, None) self.assertTrue(traverser.publishTraverse(None, 'field_mini') is data_marker)
def testFullImage(self): context = MockContext() context.field = MockField() traverser = ImageTraverser(context, None) self.assertTrue( traverser.publishTraverse(None, 'field') is data_marker)
def testCorrectFieldType(self): context = MockContext() context.field = MockField() traverser = ImageTraverser(context, None) self.assertTrue(traverser.publishTraverse(None, 'field') is data_marker)
def testUnknownScale(self): context = MockContext() context.field = MockField() traverser = ImageTraverser(context, None) self.assertTrue(traverser.publishTraverse(None, 'field_poster') is fallback_marker)
def testWrongFieldType(self): context = MockContext() context.field = BaseMockField() traverser = ImageTraverser(context, None) self.assertTrue(traverser.publishTraverse(None, 'field') is fallback_marker)
def testUnknownField(self): traverser = ImageTraverser(MockContext(), None) self.assertTrue(traverser.publishTraverse(None, 'missing') is fallback_marker)
def testFullImageInBar(self): context = MockContext() context.field_2 = MockField() traverser = ImageTraverser(context, None) self.failUnless( traverser.publishTraverse(None, 'field_2') is data_marker)
def fallbackTraverse(self, request, name): return ImageTraverser( self.context, request).publishTraverse(request, name)
def testFullImage(self): context = MockContext() context.field = MockField() traverser = ImageTraverser(context, None) self.failUnless(traverser.publishTraverse(None, 'field') is data_marker)