Move group feed from wgcharter (where it historically ended up) to wginfo, add test
- Legacy-Id: 7086
This commit is contained in:
parent
7dcaed414d
commit
86f2baea0a
|
@ -2,7 +2,7 @@ from django.conf.urls import patterns, url
|
|||
from django.views.generic import RedirectView
|
||||
|
||||
from ietf.doc.feeds import DocumentChangesFeed, InLastCallFeed
|
||||
from ietf.wgcharter.feeds import GroupChangesFeed
|
||||
from ietf.wginfo.feeds import GroupChangesFeed
|
||||
from ietf.iesg.feeds import IESGAgendaFeed
|
||||
from ietf.ipr.feeds import LatestIprDisclosuresFeed
|
||||
from ietf.liaisons.feeds import LiaisonStatementsFeed
|
||||
|
|
|
@ -121,7 +121,7 @@ def check_url_coverage():
|
|||
# skip some patterns that we don't bother with
|
||||
def ignore_pattern(regex, pattern):
|
||||
import django.views.static
|
||||
return (regex in ("^_test500/$",)
|
||||
return (regex in ("^_test500/$", "^accounts/testemail/$")
|
||||
or regex.startswith("^admin/")
|
||||
or getattr(pattern.callback, "__name__", "") == "RedirectView"
|
||||
or getattr(pattern.callback, "__name__", "") == "TemplateView"
|
||||
|
|
|
@ -14,7 +14,7 @@ from ietf.doc.models import DocEvent
|
|||
|
||||
class GroupChangesFeed(Feed):
|
||||
feed_type = Atom1Feed
|
||||
description_template = "wgcharter/feed_item_description.html"
|
||||
description_template = "wginfo/feed_item_description.html"
|
||||
|
||||
def get_object(self, request, acronym):
|
||||
return Group.objects.get(acronym=acronym)
|
|
@ -1,35 +1,3 @@
|
|||
# Portions Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
# All rights reserved. Contact: Pasi Eronen <pasi.eronen@nokia.com>
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# * Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# * Redistributions in binary form must reproduce the above
|
||||
# copyright notice, this list of conditions and the following
|
||||
# disclaimer in the documentation and/or other materials provided
|
||||
# with the distribution.
|
||||
#
|
||||
# * Neither the name of the Nokia Corporation and/or its
|
||||
# subsidiary(-ies) nor the names of its contributors may be used
|
||||
# to endorse or promote products derived from this software
|
||||
# without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
import os, unittest, shutil, calendar
|
||||
|
||||
from django.conf import settings
|
||||
|
@ -210,6 +178,28 @@ class GroupPagesTests(TestCase):
|
|||
self.assertEqual(r.status_code, 200)
|
||||
self.assertTrue(e.desc in r.content)
|
||||
|
||||
def test_feed(self):
|
||||
draft = make_test_data()
|
||||
group = draft.group
|
||||
|
||||
ge = GroupEvent.objects.create(
|
||||
group=group,
|
||||
desc="Something happened.",
|
||||
type="added_comment",
|
||||
by=Person.objects.get(name="(System)"))
|
||||
|
||||
de = DocEvent.objects.create(
|
||||
doc=group.charter,
|
||||
desc="Something else happened.",
|
||||
type="added_comment",
|
||||
by=Person.objects.get(name="(System)"))
|
||||
|
||||
r = self.client.get("/feed/group-changes/%s/" % group.acronym)
|
||||
self.assertEqual(r.status_code, 200)
|
||||
self.assertTrue(ge.desc in r.content)
|
||||
self.assertTrue(de.desc in r.content)
|
||||
|
||||
|
||||
class GroupEditTests(TestCase):
|
||||
def setUp(self):
|
||||
self.charter_dir = os.path.abspath("tmp-charter-dir")
|
||||
|
|
Loading…
Reference in a new issue