Skip to content

Commit

Permalink
As we're restoring the ability to re-schedule from the IESG agenda do…
Browse files Browse the repository at this point in the history
…cument list, we also restore the accompanying test. However, also retain the modified test which tested re-scheduling from the /edit/info/ page (under another test class name).

 - Legacy-Id: 2772
  • Loading branch information
levkowetz committed Jan 28, 2011
1 parent 1fb5a62 commit 936cb0a
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions ietf/iesg/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,48 @@
class RescheduleOnAgendaTestCase(django.test.TestCase):
fixtures = ['base', 'draft']

def test_reschedule(self):
draft = InternetDraft.objects.get(filename="draft-ietf-mipshop-pfmipv6")
draft.idinternal.telechat_date = TelechatDates.objects.all()[0].dates()[0]
draft.idinternal.agenda = True
draft.idinternal.returning_item = True
draft.idinternal.save()

form_id = draft.idinternal.draft_id
telechat_date_before = draft.idinternal.telechat_date

url = urlreverse('ietf.iesg.views.agenda_documents')
self.client.login(remote_user="klm")

# normal get
r = self.client.get(url)
self.assertEquals(r.status_code, 200)
q = PyQuery(r.content)
self.assertEquals(len(q('form select[name=%s-telechat_date]' % form_id)), 1)
self.assertEquals(len(q('form input[name=%s-clear_returning_item]' % form_id)), 1)

# reschedule
comments_before = draft.idinternal.comments().count()
d = TelechatDates.objects.all()[0].dates()[2]

r = self.client.post(url, { '%s-telechat_date' % form_id: d.strftime("%Y-%m-%d"),
'%s-clear_returning_item' % form_id: "1" })
self.assertEquals(r.status_code, 200)

# check that it moved below the right header in the DOM
d_header_pos = r.content.find("IESG telechat %s" % d.strftime("%Y-%m-%d"))
draft_pos = r.content.find(draft.filename)
self.assertTrue(d_header_pos < draft_pos)

draft = InternetDraft.objects.get(filename="draft-ietf-mipshop-pfmipv6")
self.assertEquals(draft.idinternal.telechat_date, d)
self.assertTrue(not draft.idinternal.returning_item)
self.assertEquals(draft.idinternal.comments().count(), comments_before + 1)
self.assertTrue("Telechat" in draft.idinternal.comments()[0].comment_text)

class RescheduleInEditTestCase(django.test.TestCase):
fixtures = ['base', 'draft']

def test_reschedule(self):
draft = InternetDraft.objects.get(filename="draft-ietf-mipshop-pfmipv6")
draft.idinternal.telechat_date = TelechatDates.objects.all()[0].dates()[0]
Expand Down Expand Up @@ -42,6 +84,7 @@ def test_reschedule(self):
r = self.client.post(url, { 'telechat_date': d.strftime("%Y-%m-%d"),
'returning_item': "0",
'job_owner': "49",
'area_acronym': draft.idinternal.area_acronym_id,
'note': draft.idinternal.note,
'state_change_notice_to': draft.idinternal.state_change_notice_to,
'intended_status': "6", })
Expand Down

0 comments on commit 936cb0a

Please sign in to comment.