test: Use Django 3.2 HttpResponse.headers API

This commit is contained in:
Jennifer Richards 2023-05-15 13:01:59 -03:00
parent 22bf508922
commit 0319f35e0f
No known key found for this signature in database
GPG key ID: 9B2BF5C5ADDA6A6E
2 changed files with 2 additions and 2 deletions

View file

@ -1779,7 +1779,7 @@ class DocTestCase(TestCase):
self.client.login(username='ad', password='ad+password') self.client.login(username='ad', password='ad+password')
r = self.client.post(urlreverse('ietf.doc.views_status_change.change_state',kwargs=dict(name=doc.name)),dict(new_state=iesgeval_pk)) r = self.client.post(urlreverse('ietf.doc.views_status_change.change_state',kwargs=dict(name=doc.name)),dict(new_state=iesgeval_pk))
self.assertEqual(r.status_code, 302) self.assertEqual(r.status_code, 302)
r = self.client.get(r._headers["location"][1]) r = self.client.get(r.headers["location"])
self.assertContains(r, ">IESG Evaluation<") self.assertContains(r, ">IESG Evaluation<")
self.assertEqual(len(outbox), 2) self.assertEqual(len(outbox), 2)
self.assertIn('iesg-secretary',outbox[0]['To']) self.assertIn('iesg-secretary',outbox[0]['To'])

View file

@ -556,7 +556,7 @@ class MeetingTests(BaseMeetingTestCase):
self.assertContains(r, "1. More work items underway") self.assertContains(r, "1. More work items underway")
cont_disp = r._headers.get('content-disposition', ('Content-Disposition', ''))[1] cont_disp = r.headers.get('content-disposition', ('Content-Disposition', ''))[1]
cont_disp = re.split('; ?', cont_disp) cont_disp = re.split('; ?', cont_disp)
cont_disp_settings = dict( e.split('=', 1) for e in cont_disp if '=' in e ) cont_disp_settings = dict( e.split('=', 1) for e in cont_disp if '=' in e )
filename = cont_disp_settings.get('filename', '').strip('"') filename = cont_disp_settings.get('filename', '').strip('"')