diff --git a/ietf/liaisons/formsREDESIGN.py b/ietf/liaisons/formsREDESIGN.py index 509e5876e..c1b36088b 100644 --- a/ietf/liaisons/formsREDESIGN.py +++ b/ietf/liaisons/formsREDESIGN.py @@ -80,6 +80,11 @@ class LiaisonForm(forms.Form): x = getattr(self.instance, name) if name == "purpose": # proxy has a name-clash on purpose so help it x = x.order + + try: + x = x.pk # foreign keys need the .pk, not the actual object + except AttributeError: + pass self.initial[name] = x except AttributeError: # we have some fields on the form that aren't in the model diff --git a/ietf/liaisons/tests.py b/ietf/liaisons/tests.py index 6c156080f..78cd9c43d 100644 --- a/ietf/liaisons/tests.py +++ b/ietf/liaisons/tests.py @@ -22,7 +22,7 @@ class LiaisonsUrlTestCase(SimpleUrlTestCase): return content if settings.USE_DB_REDESIGN_PROXY_CLASSES: - from ietf.liaisons.models import LiaisonStatement + from ietf.liaisons.models import LiaisonStatement, LiaisonStatementPurposeName from redesign.person.models import Person, Email from redesign.group.models import Group, Role @@ -87,7 +87,7 @@ class LiaisonManagementTestCase(django.test.TestCase): q = PyQuery(r.content) self.assertEquals(len(q('form input[name=do_action_taken]')), 0) - # logged in and get + # log in and get self.client.login(remote_user="secretary") r = self.client.get(url) @@ -103,7 +103,51 @@ class LiaisonManagementTestCase(django.test.TestCase): liaison = LiaisonStatement.objects.get(id=liaison.id) self.assertTrue(liaison.action_taken) + def test_edit_liaison(self): + make_test_data() + liaison = make_liaison_models() + url = urlreverse('liaison_edit', kwargs=dict(object_id=liaison.pk)) + login_testing_unauthorized(self, "secretary", url) + + # get + r = self.client.get(url) + self.assertEquals(r.status_code, 200) + q = PyQuery(r.content) + self.assertEquals(len(q('form input[name=from_field]')), 1) + + # edit + r = self.client.post(url, + dict(from_field="from", + replyto="replyto@example.com", + organization="org", + to_poc="to_poc@example.com", + response_contact="responce_contact@example.com", + technical_contact="technical_contact@example.com", + cc1="cc1@example.com", + purpose="4", + deadline_date=(liaison.deadline + datetime.timedelta(days=1)).strftime("%Y-%m-%d"), + title="title", + submitted_date=(liaison.submitted + datetime.timedelta(days=1)).strftime("%Y-%m-%d"), + body="body", + )) + self.assertEquals(r.status_code, 302) + new_liaison = LiaisonStatement.objects.get(id=liaison.id) + self.assertEquals(new_liaison.from_name, "from") + self.assertEquals(new_liaison.reply_to, "replyto@example.com") + self.assertEquals(new_liaison.to_name, "org") + self.assertEquals(new_liaison.to_contact, "to_poc@example.com") + self.assertEquals(new_liaison.response_contact, "responce_contact@example.com") + self.assertEquals(new_liaison.technical_contact, "technical_contact@example.com") + self.assertEquals(new_liaison.cc, "cc1@example.com") + self.assertEquals(new_liaison.purpose, LiaisonStatementPurposeName.objects.get(order=4)) + self.assertEquals(new_liaison.deadline, liaison.deadline + datetime.timedelta(days=1)), + self.assertEquals(new_liaison.title, "title") + self.assertEquals(new_liaison.submitted.date(), (liaison.submitted + datetime.timedelta(days=1)).date()) + self.assertEquals(new_liaison.body, "body") + self.assertTrue(new_liaison.modified > liaison.modified) + + # test links and edit button if not settings.USE_DB_REDESIGN_PROXY_CLASSES: # the above tests only work with the new schema diff --git a/ietf/liaisons/widgets.py b/ietf/liaisons/widgets.py index d4fc31e3c..db5366eef 100644 --- a/ietf/liaisons/widgets.py +++ b/ietf/liaisons/widgets.py @@ -88,9 +88,8 @@ class RelatedLiaisonWidget(TextInput): noliaison = 'inline' deselect = 'none' else: - from ietf.liaisons.models import LiaisonDetail if settings.USE_DB_REDESIGN_PROXY_CLASSES: - from ietf.liaisons.proxy import LiaisonDetail + from ietf.liaisons.proxy import LiaisonDetailProxy as LiaisonDetail liaison = LiaisonDetail.objects.get(pk=value) title = liaison.title if not title: diff --git a/ietf/utils/test_utils.py b/ietf/utils/test_utils.py index b77ee9637..5336f6803 100644 --- a/ietf/utils/test_utils.py +++ b/ietf/utils/test_utils.py @@ -213,8 +213,9 @@ def canonicalize_sitemap(s): def login_testing_unauthorized(tc, remote_user, url): r = tc.client.get(url) - tc.assertEquals(r.status_code, 302) - tc.assertTrue("/accounts/login" in r['Location']) + tc.assertTrue(r.status_code in (302, 403)) + if r.status_code == 302: + tc.assertTrue("/accounts/login" in r['Location']) tc.client.login(remote_user=remote_user) diff --git a/ietf/idrfc/fixtures/names.xml b/redesign/name/fixtures/names.xml similarity index 69% rename from ietf/idrfc/fixtures/names.xml rename to redesign/name/fixtures/names.xml index 904cc2171..3baf7ee5d 100644 --- a/ietf/idrfc/fixtures/names.xml +++ b/redesign/name/fixtures/names.xml @@ -36,45 +36,33 @@ 1 0 - - External Party - The document is awaiting review or input from an external party (i.e, someone other than the shepherding AD, the authors, or the WG). See the "note" field for more details on who has the action. + + Conflicts with + 1 0 - - Revised ID Needed - An updated ID is needed to address the issues that have been raised. + + Conflicts with (secondary) + + 1 + 0 + + + Conflicts with (tertiary) + 1 0 - IANA-coord - - 1 - 0 - - - AD Followup - A generic substate indicating that the shepherding AD has the action item to determine appropriate next steps. In particular, the appropriate steps (and the corresponding next state or substate) depend entirely on the nature of the issues that were raised and can only be decided with active involvement of the shepherding AD. Examples include: - -- if another AD raises an issue, the shepherding AD may first iterate with the other AD to get a better understanding of the exact issue. Or, the shepherding AD may attempt to argue that the issue is not serious enough to bring to the attention of the authors/WG. - -- if a documented issue is forwarded to a WG, some further iteration may be needed before it can be determined whether a new revision is needed or whether the WG response to an issue clarifies the issue sufficiently. - -- when a new revision appears, the shepherding AD will first look at the changes to determine whether they believe all outstanding issues have been raised satisfactorily, prior to asking the ADs who raised the original issues to verify the changes. - 1 - 0 - - - Point Raised - writeup needed - IESG discussions on the document have raised some issues that need to be brought to the attention of the authors/WG, but those issues have not been written down yet. (It is common for discussions during a telechat to result in such situations. An AD may raise a possible issue during a telechat and only decide as a result of that discussion whether the issue is worth formally writing up and bringing to the attention of the authors/WG). A document stays in the "Point Raised - Writeup Needed" state until *ALL* IESG comments that have been raised have been documented. + IANA coordination + RFC-Editor/IANA Registration Coordination 1 0 - MissingRef - + Missing references + Awaiting missing normative reference 1 0 @@ -114,6 +102,42 @@ 1 0 + + Holding for references + Holding for normative reference + 1 + 0 + + + Point Raised - writeup needed + IESG discussions on the document have raised some issues that need to be brought to the attention of the authors/WG, but those issues have not been written down yet. (It is common for discussions during a telechat to result in such situations. An AD may raise a possible issue during a telechat and only decide as a result of that discussion whether the issue is worth formally writing up and bringing to the attention of the authors/WG). A document stays in the "Point Raised - Writeup Needed" state until *ALL* IESG comments that have been raised have been documented. + 1 + 1 + + + AD Followup + A generic substate indicating that the shepherding AD has the action item to determine appropriate next steps. In particular, the appropriate steps (and the corresponding next state or substate) depend entirely on the nature of the issues that were raised and can only be decided with active involvement of the shepherding AD. Examples include: + +- if another AD raises an issue, the shepherding AD may first iterate with the other AD to get a better understanding of the exact issue. Or, the shepherding AD may attempt to argue that the issue is not serious enough to bring to the attention of the authors/WG. + +- if a documented issue is forwarded to a WG, some further iteration may be needed before it can be determined whether a new revision is needed or whether the WG response to an issue clarifies the issue sufficiently. + +- when a new revision appears, the shepherding AD will first look at the changes to determine whether they believe all outstanding issues have been raised satisfactorily, prior to asking the ADs who raised the original issues to verify the changes. + 1 + 2 + + + External Party + The document is awaiting review or input from an external party (i.e, someone other than the shepherding AD, the authors, or the WG). See the "note" field for more details on who has the action. + 1 + 3 + + + Revised ID Needed + An updated ID is needed to address the issues that have been raised. + 1 + 5 + Updates @@ -222,6 +246,30 @@ 1 0 + + Agenda + + 1 + 0 + + + Minutes + + 1 + 0 + + + Slides + + 1 + 0 + + + Liaison Attachment + + 1 + 0 + BOF @@ -294,6 +342,18 @@ 1 0 + + AG + + 1 + 0 + + + Standards Organization + + 1 + 0 + Publication Requested A formal request has been made to advance/publish the document, following the procedures in Section 7.5 of RFC 2418. The request could be from a WG chair, from an individual through the RFC Editor, etc. (The Secretariat (iesg-secretary@ietf.org) is copied on these requests to ensure that the request makes it into the ID tracker.) A document in this state has not (yet) been reviewed by an AD nor has any official action been taken on it yet (other than to note that its publication has been requested. @@ -313,7 +373,7 @@ 12 - Last Call requested + Last Call Requested The AD has requested that the Secretariat start an IETF Last Call, but the the actual Last Call message has not been sent yet. 1 15 @@ -438,6 +498,108 @@ 1 0 + + For action + + 1 + 1 + + + For comment + + 1 + 2 + + + For information + + 1 + 3 + + + In response + + 1 + 4 + + + IETF + + 1 + 0 + + + Interim + + 1 + 0 + + + AUTH + Awaiting author action + 1 + 0 + + + AUTH48 + Awaiting final author approval + 1 + 0 + + + EDIT + Approved by the stream manager (e.g., IESG, IAB, IRSG, ISE), awaiting processing and publishing + 1 + 0 + + + IANA + RFC-Editor/IANA Registration Coordination + 1 + 0 + + + IESG + Holding for IESG action + 1 + 0 + + + ISR + Independent Submission Review by the ISE + 1 + 0 + + + ISR-AUTH + Independent Submission awaiting author update, or in discussion between author and ISE + 1 + 0 + + + REF + Holding for normative reference + 1 + 0 + + + RFC-EDITOR + Awaiting final RFC Editor review before AUTH48 + 1 + 0 + + + TO + Time-out period during which the IESG reviews document for conflict/concurrence with other IETF working group work + 1 + 0 + + + MISSREF + Awaiting missing normative reference + 1 + 0 + Area Director @@ -474,6 +636,72 @@ 1 0 + + Executive Director + + 1 + 0 + + + Executive Director + + 1 + 0 + + + Administrative Director + + 1 + 0 + + + Liaison Manager + + 1 + 0 + + + Authorized Individual + + 1 + 0 + + + Waiting for Scheduling + + 1 + 0 + + + Waiting for Approval + + 1 + 0 + + + Approved + + 1 + 0 + + + Scheduled + + 1 + 0 + + + Canceled + + 1 + 0 + + + Disapproved + + 1 + 0 + Standard @@ -522,4 +750,34 @@ 1 0 + + Session + + 1 + 0 + + + Break + + 1 + 0 + + + Registration + + 1 + 0 + + + Other + + 1 + 0 + + + Plenary + + 1 + 0 + \ No newline at end of file diff --git a/ietf/idrfc/generate_fixturesREDESIGN.py b/redesign/name/generate_fixtures.py similarity index 66% rename from ietf/idrfc/generate_fixturesREDESIGN.py rename to redesign/name/generate_fixtures.py index abd47b430..6672c3f66 100755 --- a/ietf/idrfc/generate_fixturesREDESIGN.py +++ b/redesign/name/generate_fixtures.py @@ -3,9 +3,9 @@ # boiler plate import os, sys -one_dir_up = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../')) +ietf_path = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../ietf')) -sys.path.insert(0, one_dir_up) +sys.path.insert(0, ietf_path) from django.core.management import setup_environ import settings @@ -17,7 +17,7 @@ from django.db.models import Q def output(name, qs): try: - f = open(os.path.join(settings.BASE_DIR, "idrfc/fixtures/%s.xml" % name), 'w') + f = open(os.path.join(os.path.dirname(os.path.abspath(__file__)), "fixtures/%s.xml" % name), 'w') f.write(serialize("xml", qs, indent=4)) f.close() except: @@ -29,10 +29,10 @@ def output(name, qs): # pick all name models directly out of the module names = [] -import name.models -for n in dir(name.models): +import redesign.name.models +for n in dir(redesign.name.models): if n[:1].upper() == n[:1] and n.endswith("Name"): - model = getattr(name.models, n) + model = getattr(redesign.name.models, n) if not model._meta.abstract: names.extend(model.objects.all())