|
1 | | -# Portions Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
2 | | -# All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com> |
3 | | -# |
4 | | -# Redistribution and use in source and binary forms, with or without |
5 | | -# modification, are permitted provided that the following conditions |
6 | | -# are met: |
7 | | -# |
8 | | -# * Redistributions of source code must retain the above copyright |
9 | | -# notice, this list of conditions and the following disclaimer. |
10 | | -# |
11 | | -# * Redistributions in binary form must reproduce the above |
12 | | -# copyright notice, this list of conditions and the following |
13 | | -# disclaimer in the documentation and/or other materials provided |
14 | | -# with the distribution. |
15 | | -# |
16 | | -# * Neither the name of the Nokia Corporation and/or its |
17 | | -# subsidiary(-ies) nor the names of its contributors may be used |
18 | | -# to endorse or promote products derived from this software |
19 | | -# without specific prior written permission. |
20 | | -# |
21 | | -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
22 | | -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
23 | | -# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
24 | | -# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
25 | | -# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
26 | | -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
27 | | -# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
28 | | -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
29 | | -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
30 | | -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
31 | | -# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
32 | | - |
33 | 1 | import os, unittest, shutil, calendar |
34 | 2 |
|
35 | 3 | from django.conf import settings |
@@ -210,6 +178,28 @@ def test_history(self): |
210 | 178 | self.assertEqual(r.status_code, 200) |
211 | 179 | self.assertTrue(e.desc in r.content) |
212 | 180 |
|
| 181 | + def test_feed(self): |
| 182 | + draft = make_test_data() |
| 183 | + group = draft.group |
| 184 | + |
| 185 | + ge = GroupEvent.objects.create( |
| 186 | + group=group, |
| 187 | + desc="Something happened.", |
| 188 | + type="added_comment", |
| 189 | + by=Person.objects.get(name="(System)")) |
| 190 | + |
| 191 | + de = DocEvent.objects.create( |
| 192 | + doc=group.charter, |
| 193 | + desc="Something else happened.", |
| 194 | + type="added_comment", |
| 195 | + by=Person.objects.get(name="(System)")) |
| 196 | + |
| 197 | + r = self.client.get("/feed/group-changes/%s/" % group.acronym) |
| 198 | + self.assertEqual(r.status_code, 200) |
| 199 | + self.assertTrue(ge.desc in r.content) |
| 200 | + self.assertTrue(de.desc in r.content) |
| 201 | + |
| 202 | + |
213 | 203 | class GroupEditTests(TestCase): |
214 | 204 | def setUp(self): |
215 | 205 | self.charter_dir = os.path.abspath("tmp-charter-dir") |
|
0 commit comments