Skip to content

Commit 793bb14

Browse files
committed
Expand send ballot comment test to check discuss too, fix bug where it
was testing pos directly instead of pos_id - Legacy-Id: 3931
1 parent 724067a commit 793bb14

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

ietf/idrfc/testsREDESIGN.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,10 +524,13 @@ def test_send_ballot_comment(self):
524524

525525
ad = Person.objects.get(name="Aread Irector")
526526

527-
BallotPositionDocEvent.objects.create(doc=draft, type="changed_ballot_position",
528-
by=ad, ad=ad, pos=BallotPositionName.objects.get(slug="yes"),
529-
comment="Test!",
530-
comment_time=datetime.datetime.now())
527+
BallotPositionDocEvent.objects.create(
528+
doc=draft, type="changed_ballot_position",
529+
by=ad, ad=ad, pos=BallotPositionName.objects.get(slug="discuss"),
530+
discuss="This draft seems to be lacking a clearer title?",
531+
discuss_time=datetime.datetime.now(),
532+
comment="Test!",
533+
comment_time=datetime.datetime.now())
531534

532535
url = urlreverse('doc_send_ballot_comment', kwargs=dict(name=draft.name))
533536
login_testing_unauthorized(self, "ad", url)
@@ -547,9 +550,11 @@ def test_send_ballot_comment(self):
547550
self.assertEquals(len(outbox), mailbox_before + 1)
548551
m = outbox[-1]
549552
self.assertTrue("COMMENT" in m['Subject'])
553+
self.assertTrue("DISCUSS" in m['Subject'])
550554
self.assertTrue(draft.name in m['Subject'])
555+
self.assertTrue("clearer title" in str(m))
551556
self.assertTrue("Test!" in str(m))
552-
557+
553558

554559
class DeferBallotTestCase(django.test.TestCase):
555560
fixtures = ['names']

ietf/idrfc/views_ballot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,10 +462,10 @@ def send_ballot_commentREDESIGN(request, name):
462462
pos = doc.latest_event(BallotPositionDocEvent, type="changed_ballot_position", ad=ad, time__gte=started_process.time)
463463
if not pos:
464464
raise Http404()
465-
465+
466466
subj = []
467467
d = ""
468-
if pos.pos == "discuss" and pos.discuss:
468+
if pos.pos_id == "discuss" and pos.discuss:
469469
d = pos.discuss
470470
subj.append("DISCUSS")
471471
c = ""

0 commit comments

Comments
 (0)