Merged in [16607] from rcross@amsl.com:
Fix issue where third session requests, which rerequire AD approval, get left with approved status, instead of scheduled, after Secretraiat sends out notifications of official schedule. Fixes #2765.
- Legacy-Id: 16817
Note: SVN reference [16607] has been migrated to Git commit 9a82586e1b
This commit is contained in:
commit
9d4ca615d3
|
@ -18,6 +18,7 @@ from django.urls import reverse
|
|||
from ietf.group.models import Group, GroupEvent
|
||||
from ietf.meeting.models import Meeting, Room, TimeSlot, SchedTimeSessAssignment, Session
|
||||
from ietf.meeting.test_data import make_meeting_test_data
|
||||
from ietf.name.models import SessionStatusName
|
||||
from ietf.person.models import Person
|
||||
from ietf.secr.meetings.forms import get_times
|
||||
from ietf.utils.mail import outbox
|
||||
|
@ -148,16 +149,21 @@ class SecrMeetingTestCase(TestCase):
|
|||
def test_notifications(self):
|
||||
"Test Notifications"
|
||||
meeting = make_meeting_test_data()
|
||||
mars_group = Group.objects.get(acronym='mars')
|
||||
ames_group = Group.objects.get(acronym='ames')
|
||||
ames_stsa = meeting.agenda.assignments.get(session__group=ames_group)
|
||||
assert ames_stsa.session.status_id == 'schedw'
|
||||
mars_stsa = meeting.agenda.assignments.get(session__group=mars_group)
|
||||
mars_stsa.session.status = SessionStatusName.objects.get(slug='appr')
|
||||
mars_stsa.session.save()
|
||||
url = reverse('ietf.secr.meetings.views.notifications',kwargs={'meeting_id':72})
|
||||
self.client.login(username="secretary", password="secretary+password")
|
||||
response = self.client.get(url)
|
||||
self.assertEqual(response.status_code, 200)
|
||||
q = PyQuery(response.content)
|
||||
self.assertEqual(q('#id_notification_list').html(),'ames, mars')
|
||||
|
||||
|
||||
# test that only changes since last notification show up
|
||||
mars_group = Group.objects.get(acronym='mars')
|
||||
ames_group = Group.objects.get(acronym='ames')
|
||||
now = datetime.datetime.now()
|
||||
then = datetime.datetime.now()+datetime.timedelta(hours=1)
|
||||
person = Person.objects.get(name="(System)")
|
||||
|
@ -172,13 +178,17 @@ class SecrMeetingTestCase(TestCase):
|
|||
q = PyQuery(response.content)
|
||||
self.assertEqual(q('#id_notification_list').html(),'ames')
|
||||
|
||||
# test that email goes out
|
||||
# test post: email goes out, status changed
|
||||
mailbox_before = len(outbox)
|
||||
self.client.login(username="secretary", password="secretary+password")
|
||||
response = self.client.post(url)
|
||||
self.assertEqual(response.status_code, 302)
|
||||
self.assertEqual(len(outbox), mailbox_before + 1)
|
||||
|
||||
ames_stsa = meeting.agenda.assignments.get(session__group=ames_group)
|
||||
assert ames_stsa.session.status_id == 'sched'
|
||||
mars_stsa = meeting.agenda.assignments.get(session__group=mars_group)
|
||||
assert mars_stsa.session.status_id == 'sched'
|
||||
|
||||
def test_meetings_rooms(self):
|
||||
meeting = make_meeting_test_data()
|
||||
url = reverse('ietf.secr.meetings.views.rooms',kwargs={'meeting_id':72,'schedule_name':'test-agenda'})
|
||||
|
|
|
@ -571,7 +571,7 @@ def notifications(request, meeting_id):
|
|||
# ensure session state is scheduled
|
||||
for ss in meeting.agenda.assignments.all():
|
||||
session = ss.session
|
||||
if session.status.slug == "schedw":
|
||||
if session.status.slug in ["schedw", "appr"]:
|
||||
session.status_id = "sched"
|
||||
session.scheduled = datetime.datetime.now()
|
||||
session.save()
|
||||
|
|
|
@ -23,7 +23,7 @@ from django.utils.encoding import force_str, force_text
|
|||
|
||||
import debug # pyflakes:ignore
|
||||
|
||||
from ietf.submit.utils import expirable_submissions, expire_submission, ensure_person_email_info_exists
|
||||
from ietf.submit.utils import expirable_submissions, expire_submission
|
||||
from ietf.doc.factories import DocumentFactory, WgDraftFactory, IndividualDraftFactory
|
||||
from ietf.doc.models import Document, DocAlias, DocEvent, State, BallotPositionDocEvent, DocumentAuthor
|
||||
from ietf.doc.utils import create_ballot_if_not_open
|
||||
|
@ -378,8 +378,11 @@ class SubmitTests(TestCase):
|
|||
prev_author = draft.documentauthor_set.all()[0]
|
||||
if change_authors:
|
||||
# Make it such that one of the previous authors has an invalid email address
|
||||
bogus_person, bogus_email = ensure_person_email_info_exists('Bogus Person', None, draft.name)
|
||||
DocumentAuthor.objects.create(document=draft, person=bogus_person, email=bogus_email, order=draft.documentauthor_set.latest('order').order+1)
|
||||
nomail_author = PersonFactory()
|
||||
email = nomail_author.email()
|
||||
email.address='unknown-email-%s' % nomail_author.plain_ascii().replace(' ', '-')
|
||||
email.save()
|
||||
DocumentAuthor.objects.create(document=draft, person=nomail_author, email=email, order=draft.documentauthor_set.latest('order').order+1)
|
||||
|
||||
# Set the revision needed tag
|
||||
draft.tags.add("need-rev")
|
||||
|
|
Loading…
Reference in a new issue