Changeset 2747 in products


Ignore:
Timestamp:
Aug 12, 2010 2:13:44 PM (10 years ago)
Author:
mylan
Message:

#227: Updated test because of add name to INewsSitemapProvider schemaextender adapter

Location:
quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testInstallation.py

    r2600 r2747  
    5353        news = self.portal.invokeFactory("News Item", id="test_news") 
    5454        news = getattr(self.portal, "test_news") 
    55         self.assertNotEqual(lsm.queryAdapter(news, interface=ISchemaExtender), None) 
     55        self.assertNotEqual(lsm.queryAdapter( 
     56                news, interface=ISchemaExtender, 
     57                name="quintagroup.plonegooglesitemaps.newssitemapextender"), None) 
    5658 
    5759    def testUpdateCatalog(self): 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testNewsSitemaps.py

    r2744 r2747  
    187187        # check if it present in Local SiteManger only 
    188188        self.assertNotEqual(localsm, globalsm) 
    189         self.assertNotEqual(localsm.queryAdapter(self.my_news, ISchemaExtender), None) 
    190         self.assertEqual(globalsm.queryAdapter(self.my_news, ISchemaExtender), None) 
     189        self.assertNotEqual(localsm.queryAdapter( 
     190                self.my_news, ISchemaExtender, 
     191                name="quintagroup.plonegooglesitemaps.newssitemapextender"), None) 
     192        self.assertEqual(globalsm.queryAdapter( 
     193                self.my_news, ISchemaExtender, 
     194                name="quintagroup.plonegooglesitemaps.newssitemapextender"), None) 
    191195 
    192196 
     
    213217        return [ExtendableStringField("testField",),] 
    214218 
    215  
     219from quintagroup.plonegooglesitemaps.interfaces import INewsSitemapProvider 
    216220class TestNotOverrideExistingSchemaExtender(TestCase): 
    217221    """ Test if another schemaextender has been defined for the 
     
    221225         
    222226        classImplements(ATNewsItem, ITestTaggable) 
    223         provideAdapter(TestExtender) 
     227        provideAdapter(TestExtender, name=u"archetypes.schemaextender.test.adapter") 
    224228 
    225229        self.portal.invokeFactory('News Item', 'taggable-news') 
     
    229233        self.prepareContent() 
    230234        self.assert_(ITestTaggable.providedBy(self.taggable_news)) 
    231         schema = self.taggable_news.Schema() 
    232         self.assert_("gsm_access" in schema) 
    233         self.assert_("testField" in schema) 
     235        self.assert_(INewsSitemapProvider.providedBy(self.taggable_news)) 
     236        schema = self.taggable_news.Schema().keys() 
     237        self.assert_("gsm_access" in schema, "no 'gsm_access' in schema: %s" % schema) 
     238        self.assert_("testField" in schema, "no 'testField' in schema: %s" % schema) 
    234239 
    235240 
Note: See TracChangeset for help on using the changeset viewer.