@@ -60,6 +60,7 @@ def test_edit_position(self):
6060 r = self .client .post (url , dict (position = "noobj" ))
6161 self .assertEqual (r .status_code , 302 )
6262
63+ draft = Document .objects .get (name = draft .name )
6364 pos = draft .latest_event (BallotPositionDocEvent , ad = ad )
6465 self .assertEqual (pos .pos .slug , "noobj" )
6566 self .assertEqual (draft .docevent_set .count (), events_before + 1 )
@@ -70,6 +71,7 @@ def test_edit_position(self):
7071 r = self .client .post (url , dict (position = "norecord" ))
7172 self .assertEqual (r .status_code , 302 )
7273
74+ draft = Document .objects .get (name = draft .name )
7375 pos = draft .latest_event (BallotPositionDocEvent , ad = ad )
7476 self .assertEqual (pos .pos .slug , "norecord" )
7577 self .assertEqual (draft .docevent_set .count (), events_before + 1 )
@@ -80,6 +82,7 @@ def test_edit_position(self):
8082 r = self .client .post (url , dict (position = "norecord" , comment = "New comment." ))
8183 self .assertEqual (r .status_code , 302 )
8284
85+ draft = Document .objects .get (name = draft .name )
8386 pos = draft .latest_event (BallotPositionDocEvent , ad = ad )
8487 self .assertEqual (pos .pos .slug , "norecord" )
8588 self .assertEqual (draft .docevent_set .count (), events_before + 2 )
@@ -121,6 +124,7 @@ def test_api_set_position(self):
121124 r = self .client .post (url , dict (apikey = apikey .hash (), doc = draft .name , position = "noobj" ))
122125 self .assertEqual (r .status_code , 200 )
123126
127+ draft = Document .objects .get (name = draft .name )
124128 pos = draft .latest_event (BallotPositionDocEvent , ad = ad )
125129 self .assertEqual (pos .pos .slug , "noobj" )
126130 self .assertEqual (draft .docevent_set .count (), events_before + 1 )
@@ -131,6 +135,7 @@ def test_api_set_position(self):
131135 r = self .client .post (url , dict (apikey = apikey .hash (), doc = draft .name , position = "norecord" ))
132136 self .assertEqual (r .status_code , 200 )
133137
138+ draft = Document .objects .get (name = draft .name )
134139 pos = draft .latest_event (BallotPositionDocEvent , ad = ad )
135140 self .assertEqual (pos .pos .slug , "norecord" )
136141 self .assertEqual (draft .docevent_set .count (), events_before + 1 )
@@ -141,6 +146,7 @@ def test_api_set_position(self):
141146 r = self .client .post (url , dict (apikey = apikey .hash (), doc = draft .name , position = "norecord" , comment = "New comment." ))
142147 self .assertEqual (r .status_code , 200 )
143148
149+ draft = Document .objects .get (name = draft .name )
144150 pos = draft .latest_event (BallotPositionDocEvent , ad = ad )
145151 self .assertEqual (pos .pos .slug , "norecord" )
146152 self .assertEqual (draft .docevent_set .count (), events_before + 2 )
@@ -428,13 +434,15 @@ def test_edit_approval_text(self):
428434 # test regenerate
429435 r = self .client .post (url , dict (regenerate_approval_text = "1" ))
430436 self .assertEqual (r .status_code , 200 )
437+ draft = Document .objects .get (name = draft .name )
431438 self .assertTrue ("Subject: Protocol Action" in draft .latest_event (WriteupDocEvent , type = "changed_ballot_approval_text" ).text )
432439
433440 # test regenerate when it's a disapprove
434441 draft .set_state (State .objects .get (used = True , type = "draft-iesg" , slug = "nopubadw" ))
435442
436443 r = self .client .post (url , dict (regenerate_approval_text = "1" ))
437444 self .assertEqual (r .status_code , 200 )
445+ draft = Document .objects .get (name = draft .name )
438446 self .assertTrue ("NOT be published" in draft .latest_event (WriteupDocEvent , type = "changed_ballot_approval_text" ).text )
439447
440448 # test regenerate when it's a conflict review
0 commit comments