fix: correctly render wg shepherd writeups and test it. (#4316)

This commit is contained in:
Robert Sparks 2022-08-11 16:21:52 -05:00 committed by GitHub
parent 6a4142e3d0
commit 0f703a695e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View file

@ -1949,3 +1949,17 @@ class MoreReplacesTests(TestCase):
old_doc = Document.objects.get(name=old_doc.name)
self.assertEqual(old_doc.get_state_slug('draft'),'repl')
self.assertEqual(old_doc.get_state_slug('draft-stream-%s'%stream),'repl')
class ShepherdWriteupTests(TestCase):
def test_shepherd_writeup_generation(self):
ind_draft = IndividualDraftFactory(stream_id='ietf')
wg_draft = WgDraftFactory()
url = urlreverse('ietf.doc.views_draft.edit_shepherd_writeup', kwargs=dict(name=ind_draft.name))
login_testing_unauthorized(self, "secretary", url)
r = self.client.get(url)
self.assertContains(r, "for Individual Documents", status_code=200)
url = urlreverse('ietf.doc.views_draft.edit_shepherd_writeup', kwargs=dict(name=wg_draft.name))
r = self.client.get(url)
self.assertContains(r, "for Group Documents", status_code=200)

View file

@ -1025,7 +1025,7 @@ def edit_shepherd_writeup(request, name):
dict(
doc=doc,
type="individ"
if not doc.group.type.slug or doc.group.type.slug != "ietf"
if not doc.group.type.slug or doc.group.type.slug != "wg"
else "group",
stream=doc.stream.slug,
group=doc.group.type.slug,