From 30f852179c574bba1f9f453a73d2288ab1a5cdc1 Mon Sep 17 00:00:00 2001 From: Jennifer Richards Date: Mon, 19 Dec 2022 13:07:15 -0400 Subject: [PATCH] test: ensure author fields are actually changed by test (#4918) --- ietf/doc/tests.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/ietf/doc/tests.py b/ietf/doc/tests.py index 29d725c62..53ec3e943 100644 --- a/ietf/doc/tests.py +++ b/ietf/doc/tests.py @@ -1287,7 +1287,12 @@ Man Expires September 22, 2015 [Page 3] def test_edit_authors_edit_fields(self): draft = WgDraftFactory() - DocumentAuthorFactory.create_batch(3, document=draft) + DocumentAuthorFactory.create_batch( + 3, + document=draft, + affiliation='Somewhere, Inc.', + country='Bolivia', + ) url = urlreverse('ietf.doc.views_doc.edit_authors', kwargs=dict(name=draft.name)) change_reason = 'reorder the authors' @@ -1299,8 +1304,10 @@ Man Expires September 22, 2015 [Page 3] authors = draft.documentauthor_set.all(), basis=change_reason ) - - new_email = EmailFactory(person=draft.authors()[0]) + + old_email = new_email = draft.authors()[0].email() + while new_email == old_email: + new_email = EmailFactory(person=draft.authors()[0]) post_data['author-0-email'] = new_email.address post_data['author-1-affiliation'] = 'University of Nowhere' post_data['author-2-country'] = 'Chile'