Example #1
0
 def testKnownScale(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.failUnless(
         traverser.publishTraverse(None, 'field_mini') is data_marker)
Example #2
0
 def testCorrectFieldType(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.failUnless(
         traverser.publishTraverse(None, 'field') is data_marker)
Example #3
0
 def testUnknownScale(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.failUnless(
         traverser.publishTraverse(None, 'field_poster') is fallback_marker)
Example #4
0
 def testUnknownField(self):
     traverser = ImageTraverser(MockContext(), None)
     self.failUnless(
         traverser.publishTraverse(None, 'missing') is fallback_marker)
Example #5
0
 def testWrongFieldType(self):
     context = MockContext()
     context.field = BaseMockField()
     traverser = ImageTraverser(context, None)
     self.failUnless(
         traverser.publishTraverse(None, 'field') is fallback_marker)
Example #6
0
 def testKnownScale(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.assertTrue(traverser.publishTraverse(None, 'field_mini') is data_marker)
Example #7
0
 def testFullImage(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.assertTrue(
         traverser.publishTraverse(None, 'field') is data_marker)
Example #8
0
 def testCorrectFieldType(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.assertTrue(traverser.publishTraverse(None, 'field') is data_marker)
Example #9
0
 def testUnknownScale(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.assertTrue(traverser.publishTraverse(None, 'field_poster') is fallback_marker)
Example #10
0
 def testWrongFieldType(self):
     context = MockContext()
     context.field = BaseMockField()
     traverser = ImageTraverser(context, None)
     self.assertTrue(traverser.publishTraverse(None, 'field') is fallback_marker)
Example #11
0
 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)
Example #13
0
 def fallbackTraverse(self, request, name):
     return ImageTraverser(
         self.context, request).publishTraverse(request, name)
Example #14
0
 def testFullImage(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.failUnless(traverser.publishTraverse(None, 'field') is data_marker)