Commit 9da2f835 authored by Jérome Perrin's avatar Jérome Perrin

RSS: py3

parent bf341051
...@@ -596,12 +596,14 @@ class TestKM(TestKMMixIn): ...@@ -596,12 +596,14 @@ class TestKM(TestKMMixIn):
gadget_view_form_id = km_latest_documents_gadget.view_form_id gadget_view_form_id = km_latest_documents_gadget.view_form_id
publication_section_category_id_list = ['documentation', 'administration'] publication_section_category_id_list = ['documentation', 'administration']
for category_id in publication_section_category_id_list: for category_id in publication_section_category_id_list:
portal.portal_categories.publication_section.newContent(portal_type = 'Category', if category_id not in portal.portal_categories.publication_section.objectIds():
id = category_id) portal.portal_categories.publication_section.newContent(
portal_type='Category',
id=category_id)
latest_docs_subsection = self.websection.newContent(portal_type='Web Section') latest_docs_subsection = self.websection.newContent(portal_type='Web Section')
latest_docs_subsection.edit(membership_criterion_base_category = ['publication_section'], latest_docs_subsection.edit(membership_criterion_base_category=['publication_section'],
membership_criterion_category=['publication_section/%s' membership_criterion_category=['publication_section/%s'
%publication_section_category_id_list[0]]) % publication_section_category_id_list[0]])
self.tic() self.tic()
km_latest_documents_gadget_box_url = _getGadgetInstanceUrlFromKnowledgePad( km_latest_documents_gadget_box_url = _getGadgetInstanceUrlFromKnowledgePad(
self.web_section_knowledge_pad, self.web_section_knowledge_pad,
...@@ -613,11 +615,11 @@ class TestKM(TestKMMixIn): ...@@ -613,11 +615,11 @@ class TestKM(TestKMMixIn):
# add some documents to this web section # add some documents to this web section
presentation = portal.document_module.newContent( presentation = portal.document_module.newContent(
title='My presentation', title='My presentation',
portal_type = 'Presentation', portal_type='Presentation',
reference = 'Presentation-12456_', reference='Presentation-12456_',
version='001', version='001',
language='en', language='en',
publication_section_list = publication_section_category_id_list[:1]) publication_section_list=publication_section_category_id_list[:1])
presentation.publish() presentation.publish()
self.tic() self.tic()
self.changeSkin('KM') self.changeSkin('KM')
......
...@@ -58,7 +58,7 @@ def getRssDataAsDict(context, url, username=None, password=None): ...@@ -58,7 +58,7 @@ def getRssDataAsDict(context, url, username=None, password=None):
entry_dict['updated_parsed'] = entry.get('updated_parsed', None) entry_dict['updated_parsed'] = entry.get('updated_parsed', None)
result['items'].append(entry_dict) result['items'].append(entry_dict)
# sort by date # sort by date
result['items'] = sorted(result['items'], key=lambda k: k['updated_parsed']) result['items'] = sorted(result['items'], key=lambda k: k['updated_parsed'] or ())
result['items'].reverse() result['items'].reverse()
result['status'] = 0 result['status'] = 0
return result return result
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment