Changeset 2399 in products


Ignore:
Timestamp:
May 27, 2010 4:28:10 PM (14 years ago)
Author:
mylan
Message:

#131: code cleanup

Location:
quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/newssitemapview.py

    r2398 r2399  
    1515        ('publication_date', lambda x:DateTime(x.EffectiveDate).strftime("%Y-%m-%d")), 
    1616        ('keywords', lambda x:', '.join(x.Subject)), 
     17        ('title', lambda x:x.Title), 
    1718        ('name', lambda x:reTrailingParenthtical.sub("",x.Title)), 
    18         ('title', lambda x:x.Title), 
    1919        ('language', lambda x:x.Language), 
    2020        ('access', lambda x:x.gsm_access), 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/browser/templates/newssitemapview.pt

    r2398 r2399  
    1313            <n:language tal:content="result/language">news language</n:language> 
    1414        </n:publication> 
    15         <n:title tal:content="result/title">Full title of the news item</n:title> 
    16         <n:publication_date tal:content="result/publication_date">2006-08-14</n:publication_date> 
    17         <n:keywords tal:content="result/keywords">Business, Mergers, Acquisitions</n:keywords> 
    1815        <n:access tal:condition="result/access" tal:content="result/access"> 
    1916          Whether an article is available to all readers</n:access> 
    2017        <n:genres tal:condition="result/genres" tal:content="result/genres"> 
    2118          Specifies one or more properties for an article</n:genres> 
     19        <n:publication_date tal:content="result/publication_date">2006-08-14</n:publication_date> 
     20        <n:title tal:content="result/title">Full title of the news item</n:title> 
     21        <n:keywords tal:content="result/keywords">Business, Mergers, Acquisitions</n:keywords> 
    2222    </n:news> 
    2323  </url> 
  • quintagroup.plonegooglesitemaps/trunk/quintagroup/plonegooglesitemaps/tests/testNewsSitemaps.py

    r2397 r2399  
    6060 
    6161    def test_no_naccess(self): 
    62         open("/tmp/news.sm.1.xml","w").write(self.sitemap) 
    6362        self.assert_("n:access" not in self.start.keys()) 
    6463 
     
    7170        self.my_news.reindexObject() 
    7271        self.reParse() 
    73         open("/tmp/news.sm.2.xml","w").write(self.sitemap) 
    7472        self.assert_("n:access" in self.start.keys()) 
    7573        self.assert_("Registration" in self.data, "No 'Registration' in data") 
    7674 
    7775    def test_ngenres(self): 
    78         # Test when access present 
     76        # Test when genres present 
    7977        self.my_news._setProperty("gsm_genres", "PressRelease") 
    8078        self.my_news.reindexObject() 
    8179        self.reParse() 
    82         open("/tmp/news.sm.3.xml","w").write(self.sitemap) 
    8380        self.assert_("n:genres" in self.start.keys()) 
    8481        self.assert_("PressRelease" in self.data, "No 'PressRelease' in data") 
Note: See TracChangeset for help on using the changeset viewer.