예제 #1
0
 def testKnownScale(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.failUnless(
         traverser.publishTraverse(None, 'field_mini') is data_marker)
예제 #2
0
 def testCorrectFieldType(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.failUnless(
         traverser.publishTraverse(None, 'field') is data_marker)
예제 #3
0
 def testUnknownScale(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.failUnless(
         traverser.publishTraverse(None, 'field_poster') is fallback_marker)
예제 #4
0
 def testUnknownField(self):
     traverser = ImageTraverser(MockContext(), None)
     self.failUnless(
         traverser.publishTraverse(None, 'missing') is fallback_marker)
예제 #5
0
 def testWrongFieldType(self):
     context = MockContext()
     context.field = BaseMockField()
     traverser = ImageTraverser(context, None)
     self.failUnless(
         traverser.publishTraverse(None, 'field') is fallback_marker)
예제 #6
0
 def testKnownScale(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.assertTrue(traverser.publishTraverse(None, 'field_mini') is data_marker)
예제 #7
0
 def testFullImage(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.assertTrue(
         traverser.publishTraverse(None, 'field') is data_marker)
예제 #8
0
 def testCorrectFieldType(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.assertTrue(traverser.publishTraverse(None, 'field') is data_marker)
예제 #9
0
 def testUnknownScale(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.assertTrue(traverser.publishTraverse(None, 'field_poster') is fallback_marker)
예제 #10
0
 def testWrongFieldType(self):
     context = MockContext()
     context.field = BaseMockField()
     traverser = ImageTraverser(context, None)
     self.assertTrue(traverser.publishTraverse(None, 'field') is fallback_marker)
예제 #11
0
 def testUnknownField(self):
     traverser = ImageTraverser(MockContext(), None)
     self.assertTrue(traverser.publishTraverse(None, 'missing') is fallback_marker)
예제 #12
0
 def testFullImageInBar(self):
     context = MockContext()
     context.field_2 = MockField()
     traverser = ImageTraverser(context, None)
     self.failUnless(
         traverser.publishTraverse(None, 'field_2') is data_marker)
예제 #13
0
 def fallbackTraverse(self, request, name):
     return ImageTraverser(
         self.context, request).publishTraverse(request, name)
예제 #14
0
 def testFullImage(self):
     context = MockContext()
     context.field = MockField()
     traverser = ImageTraverser(context, None)
     self.failUnless(traverser.publishTraverse(None, 'field') is data_marker)