|
16 | 16 | from ietf.doc.utils_charter import ( next_revision, default_review_text, default_action_text, |
17 | 17 | charter_name_for_group ) |
18 | 18 | from ietf.doc.utils import close_open_ballots |
19 | | -from ietf.group.factories import RoleFactory |
| 19 | +from ietf.group.factories import RoleFactory, GroupFactory |
20 | 20 | from ietf.group.models import Group, GroupMilestone |
21 | 21 | from ietf.iesg.models import TelechatDate |
22 | 22 | from ietf.person.models import Person |
@@ -156,6 +156,38 @@ def find_event(t): |
156 | 156 | self.assertEqual(r.status_code, 302) |
157 | 157 | self.assertTrue("A new charter" in outbox[-3].get_payload()) |
158 | 158 |
|
| 159 | + def test_abandon_bof(self): |
| 160 | + group = GroupFactory(type_id='ietf',state_id='bof') |
| 161 | + charter = DocumentFactory(type_id='charter',group=group) |
| 162 | + # This points to some more work to do in the factories |
| 163 | + group.charter = charter |
| 164 | + group.save() |
| 165 | + url = urlreverse('ietf.doc.views_charter.change_state',kwargs={'name':charter.name,'option':'abandon'}) |
| 166 | + login_testing_unauthorized(self, "secretary", url) |
| 167 | + response=self.client.get(url) |
| 168 | + self.assertEqual(response.status_code,200) |
| 169 | + response = self.client.post(url,{'comment':'Testing Abandoning a Bof Charter'}) |
| 170 | + self.assertEqual(response.status_code,302) |
| 171 | + charter = Document.objects.get(pk=charter.pk) |
| 172 | + self.assertEqual(charter.group.state_id,'abandon') |
| 173 | + self.assertTrue('Testing Abandoning' in charter.docevent_set.filter(type='added_comment').first().desc) |
| 174 | + |
| 175 | + def test_change_title(self): |
| 176 | + group = GroupFactory(type_id='ietf') |
| 177 | + charter = DocumentFactory(type_id='charter',group=group) |
| 178 | + # This points to some more work to do in the factories |
| 179 | + group.charter = charter |
| 180 | + group.save() |
| 181 | + url = urlreverse('ietf.doc.views_charter.change_title',kwargs={'name':charter.name}) |
| 182 | + login_testing_unauthorized(self, "secretary", url) |
| 183 | + response=self.client.get(url) |
| 184 | + self.assertEqual(response.status_code,200) |
| 185 | + response=self.client.post(url,{'charter_title':'New Test Title'}) |
| 186 | + self.assertEqual(response.status_code,302) |
| 187 | + charter=Document.objects.get(pk=charter.pk) |
| 188 | + self.assertEqual(charter.title,'New Test Title') |
| 189 | + |
| 190 | + |
159 | 191 | def test_already_open_charter_ballot(self): |
160 | 192 | # make sure the right thing happens to the charter ballots as the Secretariat |
161 | 193 | # does the unusual state sequence of: intrev --> extrev --> intrev |
|
0 commit comments