[damned-lies] [vertimus] Repair feeds and add tests
- From: Claude Paroz <claudep src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [damned-lies] [vertimus] Repair feeds and add tests
- Date: Sat, 21 May 2011 18:57:34 +0000 (UTC)
commit b8952f8b86a9822620b20926048ccdd71d0671c1
Author: Claude Paroz <claude 2xlibre net>
Date: Sat May 21 20:47:57 2011 +0200
[vertimus] Repair feeds and add tests
feeds/urls.py | 6 +++---
templates/feeds/actions_title.html | 2 +-
vertimus/tests/__init__.py | 19 +++++++++++++++++++
3 files changed, 23 insertions(+), 4 deletions(-)
---
diff --git a/feeds/urls.py b/feeds/urls.py
index 74f563b..4a11f6b 100644
--- a/feeds/urls.py
+++ b/feeds/urls.py
@@ -1,7 +1,7 @@
-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'),
)
diff --git a/templates/feeds/actions_title.html b/templates/feeds/actions_title.html
index fff1add..bc132bd 100644
--- a/templates/feeds/actions_title.html
+++ b/templates/feeds/actions_title.html
@@ -1 +1 @@
-{{ 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 }}
diff --git a/vertimus/tests/__init__.py b/vertimus/tests/__init__.py
index 71c6d23..b83b3cd 100644
--- a/vertimus/tests/__init__.py
+++ b/vertimus/tests/__init__.py
@@ -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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]