|
26 | 26 |
|
27 | 27 | from ietf.community.models import CommunityList |
28 | 28 | from ietf.community.utils import reset_name_contains_index_for_rule |
29 | | -from ietf.doc.factories import WgDraftFactory, CharterFactory |
| 29 | +from ietf.doc.factories import WgDraftFactory, CharterFactory, BallotDocEventFactory |
30 | 30 | from ietf.doc.models import Document, DocAlias, DocEvent, State |
31 | 31 | from ietf.doc.utils_charter import charter_name_for_group |
32 | 32 | from ietf.group.factories import (GroupFactory, RoleFactory, GroupEventFactory, |
@@ -758,6 +758,19 @@ def test_conclude(self): |
758 | 758 | group = Group.objects.get(acronym=group.acronym) |
759 | 759 | self.assertEqual(group.state_id, "active") |
760 | 760 |
|
| 761 | + def test_replace(self): |
| 762 | + group = GroupFactory(state_id='bof') |
| 763 | + charter = CharterFactory(group=group, states=[('charter','intrev')]) |
| 764 | + BallotDocEventFactory(doc=charter, ballot_type__doc_type_id='draft', ballot_type__slug='r-extrev') |
| 765 | + url = urlreverse('ietf.group.views.edit', kwargs=dict(group_type=group.type_id, acronym=group.acronym, action="edit", field="state")) |
| 766 | + self.client.login(username='secretary',password='secretary+password') |
| 767 | + self.client.post(url, dict(state='replaced')) |
| 768 | + group = Group.objects.get(pk=group.pk) |
| 769 | + self.assertEqual(group.state_id, 'replaced') |
| 770 | + self.assertEqual(group.charter.get_state_slug('charter'), 'replaced') |
| 771 | + self.assertEqual(group.charter.active_ballot(), None) |
| 772 | + |
| 773 | + |
761 | 774 | def test_add_comment(self): |
762 | 775 | group = GroupFactory(acronym="mars",parent=GroupFactory(type_id='area')) |
763 | 776 | RoleFactory(group=group,person=Person.objects.get(user__username='ad'),name_id='ad') |
|
0 commit comments