def __call__(self):
     self.adapter = getGalleryAdapter(self.context, self.request)
     self.displayer = getDisplayAdapter(self.adapter)
     self.settings = GallerySettings(
         self.context,
         interfaces=[self.adapter.schema, self.displayer.schema])
     return self.index()
 def test_getDisplayAdapter(self):
     gadapter = getGalleryAdapter(self.portal['test_gallery'],
                                  TestRequest())
     alsoProvides(IAttributeAnnotatable, gadapter.request)
     displayer = getDisplayAdapter(gadapter)
     self.failUnless(displayer.name == 'slideshow')
     self.failUnless(gadapter.settings.display_type == 'slideshow')
 def test_getGalleryAdapter_when_asking_for_non_existant_type(self):
     gadapter = getGalleryAdapter(self.portal['test_gallery'],
         self.request, gallery_type="foobar")
     displayer = getDisplayAdapter(gadapter)
     self.assertEquals(displayer.name, 'galleria')
     self.assertEquals(gadapter.settings.display_type, 'galleria')
     self.assertEquals(gadapter.name, 'basic')
     self.assertEquals(gadapter.settings.gallery_type, 'basic')
 def __call__(self):
     self.adapter = getGalleryAdapter(self.context, self.request)
     self.displayer = getDisplayAdapter(self.adapter)
     self.settings = GallerySettings(
         self.context,
         interfaces=[self.adapter.schema, self.displayer.schema]
     )
     return self.index()
示例#5
0
 def test_getGalleryAdapter_when_asking_for_non_existant_type(self):
     gadapter = getGalleryAdapter(self.portal['test_gallery'],
         self.request, gallery_type="foobar")
     displayer = getDisplayAdapter(gadapter)
     self.assertEquals(displayer.name, 'galleria')
     self.assertEquals(gadapter.settings.display_type, 'galleria')
     self.assertEquals(gadapter.name, 'basic')
     self.assertEquals(gadapter.settings.gallery_type, 'basic')
 def test_getGalleryAdapter_when_asking_for_non_existant_type(self):
     gadapter = getGalleryAdapter(
         self.portal['test_gallery'],
         TestRequest(),
         gallery_type="foobar"
     )
     displayer = getDisplayAdapter(gadapter)
     self.failUnless(displayer.name == 'slideshow')
     self.failUnless(gadapter.settings.display_type == 'slideshow')
     self.failUnless(gadapter.name == 'basic')
     self.failUnless(gadapter.settings.gallery_type == 'basic')
 def test_getDisplayAdapter(self):
     gadapter = getGalleryAdapter(self.portal['test_gallery'],
                                  self.request)
     displayer = getDisplayAdapter(gadapter)
     self.assertEquals(displayer.name, 'galleria')
     self.assertEquals(gadapter.settings.display_type, 'galleria')
 def test_getDisplayAdapter(self):
     gadapter = getGalleryAdapter(self.portal['test_gallery'], self.request)
     displayer = getDisplayAdapter(gadapter)
     self.assertEqual(displayer.name, 'galleria')
     self.assertEqual(gadapter.settings.display_type, 'galleria')
 def test_getDisplayAdapter(self):
     gadapter = getGalleryAdapter(self.portal['test_gallery'],
                                  TestRequest())
     displayer = getDisplayAdapter(gadapter)
     self.failUnless(displayer.name == 'slideshow')
     self.failUnless(gadapter.settings.display_type == 'slideshow')