-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
40 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
from django.urls import reverse as urlreverse | ||
|
||
from ietf.doc.factories import DocumentFactory, IndividualRfcFactory, WgRfcFactory | ||
from ietf.doc.models import ( Document, DocAlias, State, DocEvent, | ||
from ietf.doc.models import ( Document, State, DocEvent, | ||
BallotPositionDocEvent, NewRevisionDocEvent, TelechatDocEvent, WriteupDocEvent ) | ||
from ietf.doc.utils import create_ballot_if_not_open | ||
from ietf.doc.views_status_change import default_approval_text | ||
|
@@ -74,7 +74,7 @@ def test_start_review(self): | |
self.assertEqual(status_change.rev,'00') | ||
self.assertEqual(status_change.ad.name,'Areað Irector') | ||
self.assertEqual(status_change.notify,'[email protected]') | ||
self.assertTrue(status_change.relateddocument_set.filter(relationship__slug='tois',target__name='draft-ietf-random-thing')) | ||
self.assertTrue(status_change.relateddocument_set.filter(relationship__slug='tois',target__name='rfc9999')) | ||
|
||
# Verify that it's possible to start a status change without a responsible ad. | ||
r = self.client.post(url,dict( | ||
|
@@ -159,8 +159,8 @@ def test_edit_notices(self): | |
self.assertTrue(doc.latest_event(DocEvent,type="added_comment").desc.startswith('Notification list changed')) | ||
|
||
# Some additional setup so there's something to put in a generated notify list | ||
doc.relateddocument_set.create(target=DocAlias.objects.get(name='rfc9999'),relationship_id='tois') | ||
doc.relateddocument_set.create(target=DocAlias.objects.get(name='rfc9998'),relationship_id='tohist') | ||
doc.relateddocument_set.create(target=Document.objects.get(name='rfc9999'),relationship_id='tois') | ||
doc.relateddocument_set.create(target=Document.objects.get(name='rfc9998'),relationship_id='tohist') | ||
|
||
# Ask the form to regenerate the list | ||
r = self.client.post(url,dict(regenerate_addresses="1")) | ||
|
@@ -263,8 +263,8 @@ def test_edit_lc(self): | |
login_testing_unauthorized(self, "ad", url) | ||
|
||
# additional setup | ||
doc.relateddocument_set.create(target=DocAlias.objects.get(name='rfc9999'),relationship_id='tois') | ||
doc.relateddocument_set.create(target=DocAlias.objects.get(name='rfc9998'),relationship_id='tohist') | ||
doc.relateddocument_set.create(target=Document.objects.get(name='rfc9999'),relationship_id='tois') | ||
doc.relateddocument_set.create(target=Document.objects.get(name='rfc9998'),relationship_id='tohist') | ||
doc.ad = Person.objects.get(name='Ad No2') | ||
doc.save_with_history([DocEvent.objects.create(doc=doc, rev=doc.rev, type="changed_document", by=Person.objects.get(user__username="secretary"), desc="Test")]) | ||
|
||
|
@@ -307,8 +307,8 @@ def test_approve(self): | |
login_testing_unauthorized(self, "secretary", url) | ||
|
||
# Some additional setup | ||
doc.relateddocument_set.create(target=DocAlias.objects.get(name='rfc9999'),relationship_id='tois') | ||
doc.relateddocument_set.create(target=DocAlias.objects.get(name='rfc9998'),relationship_id='tohist') | ||
doc.relateddocument_set.create(target=Document.objects.get(name='rfc9999'),relationship_id='tois') | ||
doc.relateddocument_set.create(target=Document.objects.get(name='rfc9998'),relationship_id='tohist') | ||
create_ballot_if_not_open(None, doc, Person.objects.get(user__username="secretary"), "statchg") | ||
doc.set_state(State.objects.get(slug='appr-pend',type='statchg')) | ||
|
||
|
@@ -348,10 +348,10 @@ def approval_pend_notice_test_helper(self, role): | |
url = urlreverse('ietf.doc.views_status_change.change_state',kwargs=dict(name=doc.name)) | ||
|
||
# Add some status change related documents | ||
doc.relateddocument_set.create(target=DocAlias.objects.get(name='rfc9999'),relationship_id='tois') | ||
doc.relateddocument_set.create(target=DocAlias.objects.get(name='rfc9998'),relationship_id='tohist') | ||
doc.relateddocument_set.create(target=Document.objects.get(name='rfc9999'),relationship_id='tois') | ||
doc.relateddocument_set.create(target=Document.objects.get(name='rfc9998'),relationship_id='tohist') | ||
# And a non-status change related document | ||
doc.relateddocument_set.create(target=DocAlias.objects.get(name='rfc14'),relationship_id='updates') | ||
doc.relateddocument_set.create(target=Document.objects.get(name='rfc14'),relationship_id='updates') | ||
|
||
login_testing_unauthorized(self, role, url) | ||
empty_outbox() | ||
|
@@ -373,9 +373,9 @@ def approval_pend_notice_test_helper(self, role): | |
self.assertTrue(notification['Subject'].startswith('Approved:')) | ||
notification_text = get_payload_text(notification) | ||
self.assertIn('The AD has approved changing the status', notification_text) | ||
self.assertIn(DocAlias.objects.get(name='rfc9999').document.canonical_name(), notification_text) | ||
self.assertIn(DocAlias.objects.get(name='rfc9998').document.canonical_name(), notification_text) | ||
self.assertNotIn(DocAlias.objects.get(name='rfc14').document.canonical_name(), notification_text) | ||
self.assertIn(Document.objects.get(name='rfc9999').canonical_name(), notification_text) | ||
self.assertIn(Document.objects.get(name='rfc9998').canonical_name(), notification_text) | ||
self.assertNotIn(Document.objects.get(name='rfc14').canonical_name(), notification_text) | ||
self.assertNotIn('No value found for', notification_text) # make sure all interpolation values were set | ||
else: | ||
self.assertEqual(len(outbox), 0) | ||
|
@@ -395,8 +395,8 @@ def test_edit_relations(self): | |
login_testing_unauthorized(self, "secretary", url) | ||
|
||
# Some additional setup | ||
doc.relateddocument_set.create(target=DocAlias.objects.get(name='rfc9999'),relationship_id='tois') | ||
doc.relateddocument_set.create(target=DocAlias.objects.get(name='rfc9998'),relationship_id='tohist') | ||
doc.relateddocument_set.create(target=Document.objects.get(name='rfc9999'),relationship_id='tois') | ||
doc.relateddocument_set.create(target=Document.objects.get(name='rfc9998'),relationship_id='tohist') | ||
|
||
# get | ||
r = self.client.get(url) | ||
|
@@ -449,9 +449,9 @@ def verify_relations(doc,target_name,status): | |
|
||
def setUp(self): | ||
super().setUp() | ||
IndividualRfcFactory(alias2__name='rfc14',name='draft-was-never-issued',std_level_id='unkn') | ||
WgRfcFactory(alias2__name='rfc9999',name='draft-ietf-random-thing',std_level_id='ps') | ||
WgRfcFactory(alias2__name='rfc9998',name='draft-ietf-random-other-thing',std_level_id='inf') | ||
IndividualRfcFactory(name='rfc14',std_level_id='unkn') | ||
WgRfcFactory(name='rfc9999',std_level_id='ps') | ||
WgRfcFactory(name='rfc9998',std_level_id='inf') | ||
DocumentFactory(type_id='statchg',name='status-change-imaginary-mid-review',notify='[email protected]') | ||
|
||
class StatusChangeSubmitTests(TestCase): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters