@@ -274,30 +274,30 @@ def test_request_last_call(self):
274274 self .assertContains (r , "Your request to issue the Last Call" )
275275
276276 # last call text
277- e = draft .latest_event (Text , type = "changed_last_call_text" )
277+ e = draft .latest_event (WriteupEvent , type = "changed_last_call_text" )
278278 self .assertTrue (e )
279- self .assertTrue ("The IESG has received" in e .content )
280- self .assertTrue (draft .title in e .content )
281- self .assertTrue (draft .get_absolute_url () in e .content )
279+ self .assertTrue ("The IESG has received" in e .text )
280+ self .assertTrue (draft .title in e .text )
281+ self .assertTrue (draft .get_absolute_url () in e .text )
282282
283283 # approval text
284- e = draft .latest_event (Text , type = "changed_ballot_approval_text" )
284+ e = draft .latest_event (WriteupEvent , type = "changed_ballot_approval_text" )
285285 self .assertTrue (e )
286- self .assertTrue ("The IESG has approved" in e .content )
287- self .assertTrue (draft .title in e .content )
288- self .assertTrue (draft .get_absolute_url () in e .content )
286+ self .assertTrue ("The IESG has approved" in e .text )
287+ self .assertTrue (draft .title in e .text )
288+ self .assertTrue (draft .get_absolute_url () in e .text )
289289
290290 # ballot writeup
291- e = draft .latest_event (Text , type = "changed_ballot_writeup_text" )
291+ e = draft .latest_event (WriteupEvent , type = "changed_ballot_writeup_text" )
292292 self .assertTrue (e )
293- self .assertTrue ("Technical Summary" in e .content )
293+ self .assertTrue ("Technical Summary" in e .text )
294294
295295 # mail notice
296296 self .assertTrue (len (mail_outbox ) > mailbox_before )
297297 self .assertTrue ("Last Call:" in mail_outbox [- 1 ]['Subject' ])
298298
299299 # comment
300- self .assertTrue ("Last call was requested" in draft .event_set . all ()[ 0 ] .desc )
300+ self .assertTrue ("Last call was requested" in draft .latest_event () .desc )
301301
302302
303303class EditInfoTestCase (django .test .TestCase ):
@@ -345,7 +345,7 @@ def test_edit_info(self):
345345 self .assertTrue (draft .tags .filter (slug = "via-rfc" ))
346346 self .assertEquals (draft .ad , new_ad )
347347 self .assertEquals (draft .note , "New note" )
348- self .assertTrue (not draft .latest_event (Telechat , type = "telechat_date" ))
348+ self .assertTrue (not draft .latest_event (TelechatEvent , type = "telechat_date" ))
349349 self .assertEquals (draft .event_set .count (), events_before + 4 )
350350 self .assertEquals (len (mail_outbox ), mailbox_before + 1 )
351351 self .assertTrue (draft .name in mail_outbox [- 1 ]['Subject' ])
@@ -367,30 +367,30 @@ def test_edit_telechat_date(self):
367367 from ietf .iesg .models import TelechatDates
368368
369369 # add to telechat
370- self .assertTrue (not draft .latest_event (Telechat , "scheduled_for_telechat" ))
370+ self .assertTrue (not draft .latest_event (TelechatEvent , "scheduled_for_telechat" ))
371371 data ["telechat_date" ] = TelechatDates .objects .all ()[0 ].date1 .isoformat ()
372372 r = self .client .post (url , data )
373373 self .assertEquals (r .status_code , 302 )
374374
375375 draft = Document .objects .get (name = draft .name )
376- self .assertTrue (draft .latest_event (Telechat , "scheduled_for_telechat" ))
377- self .assertEquals (draft .latest_event (Telechat , "scheduled_for_telechat" ).telechat_date , TelechatDates .objects .all ()[0 ].date1 )
376+ self .assertTrue (draft .latest_event (TelechatEvent , "scheduled_for_telechat" ))
377+ self .assertEquals (draft .latest_event (TelechatEvent , "scheduled_for_telechat" ).telechat_date , TelechatDates .objects .all ()[0 ].date1 )
378378
379379 # change telechat
380380 data ["telechat_date" ] = TelechatDates .objects .all ()[0 ].date2 .isoformat ()
381381 r = self .client .post (url , data )
382382 self .assertEquals (r .status_code , 302 )
383383
384384 draft = Document .objects .get (name = draft .name )
385- self .assertEquals (draft .latest_event (Telechat , "scheduled_for_telechat" ).telechat_date , TelechatDates .objects .all ()[0 ].date2 )
385+ self .assertEquals (draft .latest_event (TelechatEvent , "scheduled_for_telechat" ).telechat_date , TelechatDates .objects .all ()[0 ].date2 )
386386
387387 # remove from agenda
388388 data ["telechat_date" ] = ""
389389 r = self .client .post (url , data )
390390 self .assertEquals (r .status_code , 302 )
391391
392392 draft = Document .objects .get (name = draft .name )
393- self .assertTrue (not draft .latest_event (Telechat , "scheduled_for_telechat" ).telechat_date )
393+ self .assertTrue (not draft .latest_event (TelechatEvent , "scheduled_for_telechat" ).telechat_date )
394394
395395 def test_start_iesg_process_on_draft (self ):
396396 draft = make_test_data ()
@@ -411,6 +411,7 @@ def test_start_iesg_process_on_draft(self):
411411 self .assertTrue ('@' in q ('form input[name=notify]' )[0 ].get ('value' ))
412412
413413 # add
414+ events_before = draft .event_set .count ()
414415 mailbox_before = len (mail_outbox )
415416
416417 ad = Email .objects .get (address = "aread@ietf.org" )
@@ -430,9 +431,10 @@ def test_start_iesg_process_on_draft(self):
430431 self .assertTrue (draft .tags .filter (slug = "via-rfc" ))
431432 self .assertEquals (draft .ad , ad )
432433 self .assertEquals (draft .note , "This is a note" )
433- self .assertTrue (not draft .latest_event (Telechat , type = "scheduled_for_telechat" ))
434- self .assertEquals (draft .event_set .count (), 4 )
435- self .assertEquals (draft .event_set .order_by ('time' , '-id' )[0 ].type , "started_iesg_process" )
434+ self .assertTrue (not draft .latest_event (TelechatEvent , type = "scheduled_for_telechat" ))
435+ self .assertEquals (draft .event_set .count (), events_before + 4 )
436+ events = list (draft .event_set .order_by ('time' , 'id' ))
437+ self .assertEquals (events [- 4 ].type , "started_iesg_process" )
436438 self .assertEquals (len (mail_outbox ), mailbox_before )
437439
438440
@@ -555,7 +557,7 @@ def test_edit_position(self):
555557 comment = "This is a test." ))
556558 self .assertEquals (r .status_code , 302 )
557559
558- pos = draft .latest_event (BallotPosition , ad = ad )
560+ pos = draft .latest_event (BallotPositionEvent , ad = ad )
559561 self .assertEquals (pos .pos .slug , "discuss" )
560562 self .assertTrue ("This is a discussion test." in pos .discuss )
561563 self .assertTrue (pos .discuss_time != None )
@@ -569,7 +571,7 @@ def test_edit_position(self):
569571 r = self .client .post (url , dict (position = "noobj" ))
570572 self .assertEquals (r .status_code , 302 )
571573
572- pos = draft .latest_event (BallotPosition , ad = ad )
574+ pos = draft .latest_event (BallotPositionEvent , ad = ad )
573575 self .assertEquals (pos .pos .slug , "noobj" )
574576 self .assertEquals (draft .event_set .count (), events_before + 1 )
575577 self .assertTrue ("Position for" in pos .desc )
@@ -579,7 +581,7 @@ def test_edit_position(self):
579581 r = self .client .post (url , dict (position = "norecord" ))
580582 self .assertEquals (r .status_code , 302 )
581583
582- pos = draft .latest_event (BallotPosition , ad = ad )
584+ pos = draft .latest_event (BallotPositionEvent , ad = ad )
583585 self .assertEquals (pos .pos .slug , "norecord" )
584586 self .assertEquals (draft .event_set .count (), events_before + 1 )
585587 self .assertTrue ("Position for" in pos .desc )
@@ -589,7 +591,7 @@ def test_edit_position(self):
589591 r = self .client .post (url , dict (position = "norecord" , comment = "New comment." ))
590592 self .assertEquals (r .status_code , 302 )
591593
592- pos = draft .latest_event (BallotPosition , ad = ad )
594+ pos = draft .latest_event (BallotPositionEvent , ad = ad )
593595 self .assertEquals (pos .pos .slug , "norecord" )
594596 self .assertEquals (draft .event_set .count (), events_before + 2 )
595597 self .assertTrue ("Ballot comment text updated" in pos .desc )
@@ -612,7 +614,7 @@ def test_edit_position_as_secretary(self):
612614 r = self .client .post (url , dict (position = "discuss" ))
613615 self .assertEquals (r .status_code , 302 )
614616
615- pos = draft .latest_event (BallotPosition , ad = ad )
617+ pos = draft .latest_event (BallotPositionEvent , ad = ad )
616618 self .assertEquals (pos .pos .slug , "discuss" )
617619 self .assertTrue ("New position" in pos .desc )
618620 self .assertTrue ("by Sec" in pos .desc )
@@ -624,7 +626,7 @@ def test_send_ballot_comment(self):
624626
625627 ad = Email .objects .get (address = "aread@ietf.org" )
626628
627- BallotPosition .objects .create (doc = draft , type = "changed_ballot_position" ,
629+ BallotPositionEvent .objects .create (doc = draft , type = "changed_ballot_position" ,
628630 by = ad , ad = ad , pos = BallotPositionName .objects .get (slug = "yes" ),
629631 comment = "Test!" ,
630632 comment_time = datetime .datetime .now ())
@@ -730,7 +732,7 @@ def test_edit_last_call_text(self):
730732 save_last_call_text = "1" ))
731733 self .assertEquals (r .status_code , 200 )
732734 draft = Document .objects .get (name = draft .name )
733- self .assertTrue ("This is a simple test" in draft .latest_event (Text , type = "changed_last_call_text" ).content )
735+ self .assertTrue ("This is a simple test" in draft .latest_event (WriteupEvent , type = "changed_last_call_text" ).text )
734736
735737 # test regenerate
736738 r = self .client .post (url , dict (
@@ -739,7 +741,7 @@ def test_edit_last_call_text(self):
739741 self .assertEquals (r .status_code , 200 )
740742 q = PyQuery (r .content )
741743 draft = Document .objects .get (name = draft .name )
742- self .assertTrue ("Subject: Last Call" in draft .latest_event (Text , type = "changed_last_call_text" ).content )
744+ self .assertTrue ("Subject: Last Call" in draft .latest_event (WriteupEvent , type = "changed_last_call_text" ).text )
743745
744746
745747 def test_request_last_call (self ):
@@ -755,7 +757,7 @@ def test_request_last_call(self):
755757
756758 # send
757759 r = self .client .post (url , dict (
758- last_call_text = draft .latest_event (Text , type = "changed_last_call_text" ).content ,
760+ last_call_text = draft .latest_event (WriteupEvent , type = "changed_last_call_text" ).text ,
759761 send_last_call_request = "1" ))
760762 draft = Document .objects .get (name = draft .name )
761763 self .assertEquals (draft .iesg_state_id , "lc-req" )
@@ -781,7 +783,7 @@ def test_edit_ballot_writeup(self):
781783 save_ballot_writeup = "1" ))
782784 self .assertEquals (r .status_code , 200 )
783785 draft = Document .objects .get (name = draft .name )
784- self .assertTrue ("This is a simple test" in draft .latest_event (Text , type = "changed_ballot_writeup_text" ).content )
786+ self .assertTrue ("This is a simple test" in draft .latest_event (WriteupEvent , type = "changed_ballot_writeup_text" ).text )
785787
786788 def test_issue_ballot (self ):
787789 draft = make_test_data ()
@@ -790,7 +792,7 @@ def test_issue_ballot(self):
790792
791793 def create_pos (num , vote , comment = "" , discuss = "" ):
792794 ad = Email .objects .get (address = "ad%s@ietf.org" % num )
793- e = BallotPosition ()
795+ e = BallotPositionEvent ()
794796 e .doc = draft
795797 e .by = ad
796798 e .ad = ad
@@ -815,11 +817,11 @@ def create_pos(num, vote, comment="", discuss=""):
815817 create_pos (9 , "yes" )
816818
817819 # we need approval text to be able to submit
818- e = Text ()
820+ e = WriteupEvent ()
819821 e .doc = draft
820822 e .by = Email .objects .get (address = "aread@ietf.org" )
821823 e .type = "changed_ballot_approval_text"
822- e .content = "The document has been approved."
824+ e .text = "The document has been approved."
823825 e .save ()
824826
825827 mailbox_before = len (mail_outbox )
@@ -859,13 +861,13 @@ def test_edit_approval_text(self):
859861 save_approval_text = "1" ))
860862 self .assertEquals (r .status_code , 200 )
861863 draft = Document .objects .get (name = draft .name )
862- self .assertTrue ("This is a simple test" in draft .latest_event (Text , type = "changed_ballot_approval_text" ).content )
864+ self .assertTrue ("This is a simple test" in draft .latest_event (WriteupEvent , type = "changed_ballot_approval_text" ).text )
863865
864866 # test regenerate
865867 r = self .client .post (url , dict (regenerate_approval_text = "1" ))
866868 self .assertEquals (r .status_code , 200 )
867869 draft = Document .objects .get (name = draft .name )
868- self .assertTrue ("Subject: Protocol Action" in draft .latest_event (Text , type = "changed_ballot_approval_text" ).content )
870+ self .assertTrue ("Subject: Protocol Action" in draft .latest_event (WriteupEvent , type = "changed_ballot_approval_text" ).text )
869871
870872 # test regenerate when it's a disapprove
871873 draft .iesg_state_id = "nopubadw"
@@ -874,7 +876,7 @@ def test_edit_approval_text(self):
874876 r = self .client .post (url , dict (regenerate_approval_text = "1" ))
875877 self .assertEquals (r .status_code , 200 )
876878 draft = Document .objects .get (name = draft .name )
877- self .assertTrue ("NOT be published" in draft .latest_event (Text , type = "changed_ballot_approval_text" ).content )
879+ self .assertTrue ("NOT be published" in draft .latest_event (WriteupEvent , type = "changed_ballot_approval_text" ).text )
878880
879881class ApproveBallotTestCase (django .test .TestCase ):
880882 fixtures = ['names' ]
@@ -955,7 +957,7 @@ def test_make_last_call(self):
955957
956958 draft = Document .objects .get (name = draft .name )
957959 self .assertEquals (draft .iesg_state .slug , "lc" )
958- self .assertEquals (draft .latest_event (Expiration , "sent_last_call" ).expires .strftime ("%Y-%m-%d" ), expire_date )
960+ self .assertEquals (draft .latest_event (LastCallEvent , "sent_last_call" ).expires .strftime ("%Y-%m-%d" ), expire_date )
959961 self .assertEquals (len (mail_outbox ), mailbox_before + 4 )
960962
961963 self .assertTrue ("Last Call" in mail_outbox [- 4 ]['Subject' ])
0 commit comments