Commit bf0c7b73 authored by Sam Ruby's avatar Sam Ruby

Fix regression where entry updated was always ignored

parent ccb5aa4e
......@@ -259,7 +259,7 @@ def spiderFeed(feed, only_if_new=0, content=None, resp_headers=None):
mtime = None
if not entry.has_key('updated_parsed') or not entry['updated_parsed']:
entry['updated_parsed'] = entry.get('published_parsed',None)
if not entry.has_key('updated_parsed'):
if entry.has_key('updated_parsed'):
try:
mtime = calendar.timegm(entry.updated_parsed)
except:
......
......@@ -59,7 +59,7 @@ class SpiderTest(unittest.TestCase):
self.assertEqual(['application/atom+xml'], [link.type
for link in data.entries[0].source.links if link.rel=='self'])
self.assertEqual('one', data.entries[0].source.planet_name)
self.assertEqual('2006-01-01T00:00:00Z', data.entries[0].updated)
self.assertEqual('2006-01-03T00:00:00Z', data.entries[0].updated)
self.assertEqual(os.stat(files[2]).st_mtime,
calendar.timegm(data.entries[0].updated_parsed))
......
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