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