|
20 | 20 |
|
21 | 21 | from ietf.doc.models import Document, DocAlias, DocEvent, State |
22 | 22 | from ietf.group.models import Group, GroupEvent, GroupMilestone, GroupStateTransitions, Role |
23 | | -from ietf.group.utils import save_group_in_history, setup_default_community_list_for_group |
| 23 | +from ietf.group.utils import save_group_in_history, reset_name_contains_index_for_rule |
24 | 24 | from ietf.name.models import DocTagName, GroupStateName, GroupTypeName |
25 | 25 | from ietf.person.models import Person, Email |
26 | 26 | from ietf.utils.test_utils import TestCase, unicontent |
|
29 | 29 | from ietf.utils.test_utils import login_testing_unauthorized |
30 | 30 | from ietf.group.factories import GroupFactory, RoleFactory, GroupEventFactory |
31 | 31 | from ietf.meeting.factories import SessionFactory |
| 32 | +from ietf.community.models import CommunityList |
32 | 33 |
|
33 | 34 | class GroupPagesTests(TestCase): |
34 | 35 | def setUp(self): |
@@ -88,6 +89,22 @@ def test_active_groups(self): |
88 | 89 | with self.assertRaises(NoReverseMatch): |
89 | 90 | url=urlreverse('ietf.group.views.active_groups', kwargs=dict(group_type=slug)) |
90 | 91 |
|
| 92 | + def test_group_home(self): |
| 93 | + draft = make_test_data() |
| 94 | + group = draft.group |
| 95 | + |
| 96 | + url = urlreverse('ietf.group.views.group_home', kwargs=dict(acronym=group.acronym)) |
| 97 | + next = urlreverse('ietf.group.views.group_documents', kwargs=dict(acronym=group.acronym)) |
| 98 | + r = self.client.get(url) |
| 99 | + self.assertRedirects(r, next) |
| 100 | + r = self.client.get(next) |
| 101 | + self.assertTrue(group.acronym in unicontent(r)) |
| 102 | + self.assertTrue(group.name in unicontent(r)) |
| 103 | + for word in ['Documents', 'Date', 'Status', 'IPR', 'AD', 'Shepherd']: |
| 104 | + self.assertTrue(word in unicontent(r)) |
| 105 | + self.assertTrue(draft.name in unicontent(r)) |
| 106 | + self.assertTrue(draft.title in unicontent(r)) |
| 107 | + |
91 | 108 | def test_wg_summaries(self): |
92 | 109 | draft = make_test_data() |
93 | 110 | group = draft.group |
@@ -193,7 +210,9 @@ def test_group_documents(self): |
193 | 210 | name=draft2.name, |
194 | 211 | ) |
195 | 212 |
|
196 | | - setup_default_community_list_for_group(group) |
| 213 | + clist = CommunityList.objects.get(group=group) |
| 214 | + related_docs_rule = clist.searchrule_set.get(rule_type='name_contains') |
| 215 | + reset_name_contains_index_for_rule(related_docs_rule) |
197 | 216 |
|
198 | 217 | url = urlreverse('ietf.group.views.group_documents', kwargs=dict(group_type=group.type_id, acronym=group.acronym)) |
199 | 218 | r = self.client.get(url) |
|
0 commit comments