@@ -80,9 +80,15 @@ def test_draftviewset_references(self):
8080 def test_notify_rfc_published (self ):
8181 url = urlreverse ("ietf.api.purple_api.notify_rfc_published" )
8282 area = GroupFactory (type_id = "area" )
83+ rfc_group = GroupFactory (type_id = "wg" )
8384 draft_ad = RoleFactory (group = area , name_id = "ad" ).person
84- authors = PersonFactory .create_batch (2 )
85- draft = WgDraftFactory (group__parent = area , authors = authors )
85+ rfc_ad = PersonFactory ()
86+ draft_authors = PersonFactory .create_batch (2 )
87+ rfc_authors = PersonFactory .create_batch (3 )
88+ draft = WgDraftFactory (
89+ group__parent = area , authors = draft_authors , ad = draft_ad , stream_id = "ietf"
90+ )
91+ rfc_stream_id = "ise"
8692 assert isinstance (draft , Document ), "WgDraftFactory should generate a Document"
8793 unused_rfc_number = (
8894 Document .objects .filter (rfc_number__isnull = False ).aggregate (
@@ -96,7 +102,7 @@ def test_notify_rfc_published(self):
96102 "draft_name" : draft .name ,
97103 "draft_rev" : draft .rev ,
98104 "rfc_number" : unused_rfc_number ,
99- "title" : draft .title ,
105+ "title" : "RFC " + draft .title ,
100106 "authors" : [
101107 {
102108 "titlepage_name" : f"titlepage { author .name } " ,
@@ -106,17 +112,14 @@ def test_notify_rfc_published(self):
106112 "affiliation" : "Some Affiliation" ,
107113 "country" : "CA" ,
108114 }
109- for author in authors
115+ for author in rfc_authors
110116 ],
111- "group" : draft .group .acronym ,
112- "stream" : draft .stream_id ,
113- "abstract" : draft .abstract ,
114- "pages" : draft .pages ,
115- "words" : draft .pages * 250 ,
116- "formal_languages" : [],
117+ "group" : rfc_group .acronym ,
118+ "stream" : rfc_stream_id ,
119+ "abstract" : "RFC version of " + draft .abstract ,
120+ "pages" : draft .pages + 10 ,
117121 "std_level" : "ps" ,
118- "ad" : draft_ad .pk ,
119- "note" : "noted" ,
122+ "ad" : rfc_ad .pk ,
120123 "obsoletes" : [],
121124 "updates" : [],
122125 "subseries" : [],
@@ -137,7 +140,7 @@ def test_notify_rfc_published(self):
137140 ).count (),
138141 1 ,
139142 )
140- self .assertEqual (rfc .title , draft .title )
143+ self .assertEqual (rfc .title , "RFC " + draft .title )
141144 self .assertEqual (rfc .documentauthor_set .count (), 0 )
142145 self .assertEqual (
143146 list (
@@ -159,18 +162,15 @@ def test_notify_rfc_published(self):
159162 "affiliation" : "Some Affiliation" ,
160163 "country" : "CA" ,
161164 }
162- for author in authors
165+ for author in rfc_authors
163166 ],
164167 )
165- self .assertEqual (rfc .group , draft .group )
166- self .assertEqual (rfc .stream , draft .stream )
167- self .assertEqual (rfc .abstract , draft .abstract )
168- self .assertEqual (rfc .pages , draft .pages )
169- self .assertEqual (rfc .words , draft .pages * 250 )
170- self .assertEqual (rfc .formal_languages .count (), 0 )
168+ self .assertEqual (rfc .group , rfc_group )
169+ self .assertEqual (rfc .stream_id , rfc_stream_id )
170+ self .assertEqual (rfc .abstract , "RFC version of " + draft .abstract )
171+ self .assertEqual (rfc .pages , draft .pages + 10 )
171172 self .assertEqual (rfc .std_level_id , "ps" )
172- self .assertEqual (rfc .ad , draft_ad )
173- self .assertEqual (rfc .note , "noted" )
173+ self .assertEqual (rfc .ad , rfc_ad )
174174 self .assertEqual (rfc .related_that_doc ("obs" ), [])
175175 self .assertEqual (rfc .related_that_doc ("updates" ), [])
176176 self .assertEqual (rfc .part_of (), [])
0 commit comments