1010
1111import debug # pyflakes:ignore
1212
13- from ietf .doc .factories import DocumentFactory
13+ from ietf .doc .factories import DocumentFactory , CharterFactory
1414from ietf .doc .models import ( Document , State , BallotDocEvent , BallotType , NewRevisionDocEvent ,
1515 TelechatDocEvent , WriteupDocEvent )
1616from ietf .doc .utils_charter import ( next_revision , default_review_text , default_action_text ,
1717 charter_name_for_group )
1818from ietf .doc .utils import close_open_ballots
19- from ietf .group .factories import RoleFactory , GroupFactory
19+ from ietf .group .factories import RoleFactory
2020from ietf .group .models import Group , GroupMilestone
2121from ietf .iesg .models import TelechatDate
2222from ietf .person .models import Person
@@ -157,11 +157,7 @@ def find_event(t):
157157 self .assertTrue ("A new charter" in outbox [- 3 ].get_payload ())
158158
159159 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 ()
160+ charter = CharterFactory (group__state_id = 'bof' ,group__type_id = 'wg' )
165161 url = urlreverse ('ietf.doc.views_charter.change_state' ,kwargs = {'name' :charter .name ,'option' :'abandon' })
166162 login_testing_unauthorized (self , "secretary" , url )
167163 response = self .client .get (url )
@@ -173,11 +169,7 @@ def test_abandon_bof(self):
173169 self .assertTrue ('Testing Abandoning' in charter .docevent_set .filter (type = 'added_comment' ).first ().desc )
174170
175171 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 ()
172+ charter = CharterFactory (group__type_id = 'wg' )
181173 url = urlreverse ('ietf.doc.views_charter.change_title' ,kwargs = {'name' :charter .name })
182174 login_testing_unauthorized (self , "secretary" , url )
183175 response = self .client .get (url )
0 commit comments