Beispiel #1
0
 def testUnknownScale(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.failUnless(
         traverser.publishTraverse(None, 'field_poster') is fallback_marker)
Beispiel #2
0
 def testKnownScale(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.failUnless(
         traverser.publishTraverse(None, 'field_mini') is data_marker)
Beispiel #3
0
 def testWrongFieldType(self):
     context = MockContext()
     context.field = BaseMockField()
     traverser = ImageTraverser(context, None)
     self.failUnless(
         traverser.publishTraverse(None, 'field') is fallback_marker)
Beispiel #4
0
 def testCorrectFieldType(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.failUnless(
         traverser.publishTraverse(None, 'field') is data_marker)
Beispiel #5
0
 def testFullImage(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.assertTrue(
         traverser.publishTraverse(None, 'field') is data_marker)
Beispiel #6
0
 def testUnknownField(self):
     traverser = ImageTraverser(MockContext(), None)
     self.failUnless(
         traverser.publishTraverse(None, 'missing') is fallback_marker)
 def testUnknownScale(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.assertTrue(traverser.publishTraverse(None, 'field_poster') 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 testCorrectFieldType(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.assertTrue(traverser.publishTraverse(None, 'field') is data_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 testFullImage(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.failUnless(traverser.publishTraverse(None, 'field') is data_marker)