Skip to content

Commit 6079289

Browse files
committed
fix: Improve ballot clearing tests
1 parent f47d30c commit 6079289

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

ietf/doc/tests_status_change.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -495,10 +495,14 @@ def test_clear_ballot(self):
495495
doc.relateddocument_set.create(target=Document.objects.get(name='rfc9998'),relationship_id='tohist')
496496
create_ballot_if_not_open(None, doc, Person.objects.get(user__username="secretary"), "statchg")
497497
doc.set_state(State.objects.get(slug='iesgeval',type='statchg'))
498+
old_ballot = doc.ballot_open("statchg")
499+
self.assertIsNotNone(old_ballot)
498500

499501
r = self.client.post(url, dict())
500502
self.assertEqual(r.status_code,302)
501-
self.assertTrue(doc.ballot_open("statchg"))
503+
new_ballot = doc.ballot_open("statchg")
504+
self.assertIsNotNone(new_ballot)
505+
self.assertNotEqual(new_ballot, old_ballot)
502506
self.assertEqual(doc.get_state_slug("statchg"),"iesgeval")
503507

504508
def test_clear_deferred_ballot(self):
@@ -511,10 +515,14 @@ def test_clear_deferred_ballot(self):
511515
doc.relateddocument_set.create(target=Document.objects.get(name='rfc9998'),relationship_id='tohist')
512516
create_ballot_if_not_open(None, doc, Person.objects.get(user__username="secretary"), "statchg")
513517
doc.set_state(State.objects.get(slug='defer',type='statchg'))
518+
old_ballot = doc.ballot_open("statchg")
519+
self.assertIsNotNone(old_ballot)
514520

515521
r = self.client.post(url, dict())
516522
self.assertEqual(r.status_code,302)
517-
self.assertTrue(doc.ballot_open("statchg"))
523+
new_ballot = doc.ballot_open("statchg")
524+
self.assertIsNotNone(new_ballot)
525+
self.assertNotEqual(new_ballot, old_ballot)
518526
self.assertEqual(doc.get_state_slug("statchg"),"iesgeval")
519527

520528
def setUp(self):

0 commit comments

Comments
 (0)