Commit b8952f8b authored by Claude Paroz's avatar Claude Paroz

[vertimus] Repair feeds and add tests

parent 19a9158a
from django.conf.urls.defaults import *
from django.conf.urls.defaults import patterns, url
from vertimus.feeds import LatestActionsByLanguage, LatestActionsByTeam
urlpatterns = patterns('',
(r'^languages/(?P<locale>.*)/$', LatestActionsByLanguage()),
(r'^teams/(?P<team_name>.*)/$', LatestActionsByTeam()),
url(r'^languages/(?P<locale>.*)/$', LatestActionsByLanguage(), name='lang_feed'),
url(r'^teams/(?P<team_name>.*)/$', LatestActionsByTeam(), name='team_feed'),
)
{{ obj.state.domain }} - {{ obj.state.branch.module.name }} ({{ obj.state.branch.name }}) - {{ obj.description }}
{{ obj.state_db.domain }} - {{ obj.state_db.branch.module.name }} ({{ obj.state_db.branch.name }}) - {{ obj.description }}
......@@ -384,6 +384,25 @@ class VertimusTest(TeamsAndRolesTests):
form = ActionForm([('WC', u'Write a comment')], post_content)
self.assert_(form.is_valid())
def test_feeds(self):
state = StateNone(branch=self.b, domain=self.d, language=self.l)
state.save()
action = Action.new_by_name('RT', person=self.pt, comment="Translating")
action.apply_on(state)
response = self.client.get(reverse('lang_feed', args=[self.l.locale]))
self.assertContains(response,
"""<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">""")
self.assertContains(response,
"""<title>po (gedit/User Interface) - gedit (gnome-2-24) - Reserve for translation\n</title>""")
self.assertContains(response,
"""<guid>http://example.com/vertimus/gedit/gnome-2-24/po/fr#1</guid>""")
response = self.client.get(reverse('team_feed', args=[self.l.team.name]))
self.assertContains(response,
"""<title>po (gedit/User Interface) - gedit (gnome-2-24) - Reserve for translation\n</title>""")
def test_mysql(self):
# Copied from test_action_undo() with minor changes
state = StateNone(branch=self.b, domain=self.d, language=self.l)
......
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