Skip to content

Commit

Permalink
use addon.last_updated in feeds (bug 589012)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Balogh committed Aug 20, 2010
1 parent 1d46a37 commit b1d59a9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apps/addons/fixtures/addons/featured.json
Expand Up @@ -242,7 +242,7 @@
"filename": "yahoo_toolbar-10.0.42-fx.xpi",
"platform": 1,
"version": 1001,
"datestatuschanged": null,
"datestatuschanged": "2007-04-04 12:30:11",
"size": 169
}
},
Expand All @@ -258,7 +258,7 @@
"filename": "del.icio.us_bookmarks-1.0.43-fx.xpi",
"platform": 1,
"version": 1003,
"datestatuschanged": null,
"modified": "2007-04-04 12:30:11",
"size": 169
}
}
Expand Down
2 changes: 1 addition & 1 deletion apps/browse/feeds.py
Expand Up @@ -35,7 +35,7 @@ def item_author_name(self, addon):

def item_pubdate(self, addon):
"""Pubdate for a particuar add-on (<item><pubDate>)"""
return addon.created
return addon.last_updated

def item_guid(self, addon):
"""Guid for a particuar version (<item><guid>)"""
Expand Down
8 changes: 7 additions & 1 deletion apps/browse/tests.py
Expand Up @@ -11,10 +11,10 @@

import amo
import amo.test_utils
import addons.cron
from amo.urlresolvers import reverse
from amo.helpers import urlparams
from addons.models import Addon, Category
from addons.cron import _update_appsupport
from browse import views, feeds
from browse.views import locale_display_name
from translations.models import Translation
Expand Down Expand Up @@ -257,6 +257,7 @@ def redirects(from_, to):
redirects('/recommended', '/featured')
redirects('/recommended/format:rss', '/featured/format:rss')


class TestFeaturedPage(amo.test_utils.ExtraSetup, test_utils.TestCase):
fixtures = ('base/apps', 'addons/featured')

Expand All @@ -266,6 +267,7 @@ def test_featured_addons(self):
response = self.client.get(reverse('browse.featured'))
eq_([1001, 1003], sorted(a.id for a in response.context['addons']))


class TestCategoriesFeed(test_utils.TestCase):

def setUp(self):
Expand Down Expand Up @@ -293,9 +295,13 @@ def test_item_guid(self):
t = self.feed.item_guid(self.addon)
assert t.endswith(u'/addon/2/versions/v%s' % urllib.urlquote(self.u))


class TestFeaturedFeed(amo.test_utils.ExtraSetup, test_utils.TestCase):
fixtures = ('base/apps', 'addons/featured')

def setUp(self):
addons.cron.addon_last_updated()

def test_feed_elements_present(self):
"""specific elements are present and reasonably well formed"""
url = reverse('browse.featured.rss')
Expand Down

0 comments on commit b1d59a9

Please sign in to comment.