-
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.
fix: continued repair of code/tests re: RelatedDocument model change
- Loading branch information
Showing
10 changed files
with
42 additions
and
54 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -369,7 +369,6 @@ def submit_new_wg(self, formats): | |
|
||
# supply submitter info, then draft should be in and ready for approval | ||
mailbox_before = len(outbox) | ||
replaced_alias = draft.docalias.first() | ||
r = self.supply_extra_metadata(name, status_url, author.ascii, author.email().address.lower(), | ||
replaces=[str(draft.pk), str(sug_replaced_draft.pk)]) | ||
|
||
|
@@ -1253,7 +1252,7 @@ def submit_new_individual_replacing_wg(self, logged_in=False, group_state_id='ac | |
status_url, | ||
"Submitter Name", | ||
"[email protected]", | ||
replaces=[str(replaced_draft.docalias.first().pk)], | ||
replaces=[str(replaced_draft.pk)], | ||
) | ||
|
||
submission = Submission.objects.get(name=name, rev=rev) | ||
|
@@ -1403,7 +1402,7 @@ def test_edit_submission_and_force_post(self): | |
"edit-pages": "123", | ||
"submitter-name": "Some Random Test Person", | ||
"submitter-email": "[email protected]", | ||
"replaces": [str(draft.docalias.first().pk)], | ||
"replaces": [str(draft.pk)], | ||
"edit-note": "no comments", | ||
"authors-0-name": "Person 1", | ||
"authors-0-email": "[email protected]", | ||
|
@@ -1422,7 +1421,7 @@ def test_edit_submission_and_force_post(self): | |
self.assertEqual(submission.pages, 123) | ||
self.assertEqual(submission.note, "no comments") | ||
self.assertEqual(submission.submitter, "Some Random Test Person <[email protected]>") | ||
self.assertEqual(submission.replaces, draft.docalias.first().name) | ||
self.assertEqual(submission.replaces, draft.name) | ||
self.assertEqual(submission.state_id, "manual") | ||
|
||
authors = submission.authors | ||
|
@@ -3091,7 +3090,7 @@ def test_replaces_field(self): | |
# can't replace RFC | ||
rfc = WgRfcFactory() | ||
draft = WgDraftFactory(states=[("draft", "rfc")]) | ||
draft.relateddocument_set.create(relationship_id="became_rfc", target=rfc.docalias.first()) | ||
draft.relateddocument_set.create(relationship_id="became_rfc", target=rfc) | ||
form = SubmissionAutoUploadForm( | ||
request_factory.get('/some/url'), | ||
data={'user': auth.user.username, 'replaces': draft.name}, | ||
|
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 |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
import debug # pyflakes:ignore | ||
|
||
from ietf.doc.models import Document, DocAlias, State, DocumentAuthor, DocEvent, RelatedDocument, NewRevisionDocEvent | ||
from ietf.doc.factories import IndividualDraftFactory, ConflictReviewFactory, StatusChangeFactory, WgDraftFactory, WgRfcFactory | ||
from ietf.group.models import Group, GroupHistory, Role, RoleHistory | ||
from ietf.iesg.models import TelechatDate | ||
from ietf.ipr.models import HolderIprDisclosure, IprDocRel, IprDisclosureStateName, IprLicenseTypeName | ||
|
@@ -391,37 +392,27 @@ def make_test_data(): | |
) | ||
|
||
# an independent submission before review | ||
doc = Document.objects.create(name='draft-imaginary-independent-submission',type_id='draft',rev='00', | ||
title="Some Independent Notes on Imagination") | ||
doc.set_state(State.objects.get(used=True, type="draft", slug="active")) | ||
DocAlias.objects.create(name=doc.name).docs.add(doc) | ||
IndividualDraftFactory(title="Some Independent Notes on Imagination") | ||
|
||
# an irtf submission mid review | ||
doc = Document.objects.create(name='draft-imaginary-irtf-submission', type_id='draft',rev='00', | ||
stream=StreamName.objects.get(slug='irtf'), title="The Importance of Research Imagination") | ||
docalias = DocAlias.objects.create(name=doc.name) | ||
docalias.docs.add(doc) | ||
doc.set_state(State.objects.get(type="draft", slug="active")) | ||
crdoc = Document.objects.create(name='conflict-review-imaginary-irtf-submission', type_id='conflrev', | ||
rev='00', notify="[email protected]", title="Conflict Review of IRTF Imagination Document") | ||
DocAlias.objects.create(name=crdoc.name).docs.add(crdoc) | ||
crdoc.set_state(State.objects.get(name='Needs Shepherd', type__slug='conflrev')) | ||
crdoc.relateddocument_set.create(target=docalias,relationship_id='conflrev') | ||
doc = IndividualDraftFactory(name="draft-imaginary-irtf-submission", stream_id="irtf", title="The Importance of Research Imagination") | ||
ConflictReviewFactory(name="conflict-review-imaginary-irtf-submission", review_of=doc, notify="[email protected]", title="Conflict Review of IRTF Imagination Document") | ||
|
||
# A status change mid review | ||
iesg = Group.objects.get(acronym='iesg') | ||
doc = Document.objects.create(name='status-change-imaginary-mid-review',type_id='statchg', rev='00', | ||
notify="[email protected]", group=iesg, title="Status Change Review without Imagination") | ||
doc.set_state(State.objects.get(slug='needshep',type__slug='statchg')) | ||
docalias = DocAlias.objects.create(name='status-change-imaginary-mid-review') | ||
docalias.docs.add(doc) | ||
doc = StatusChangeFactory( | ||
name='status-change-imaginary-mid-review', | ||
notify="[email protected]", | ||
group=iesg, | ||
title="Status Change Review without Imagination", | ||
states= [State.objects.get(type_id="statchg",slug="needshep")] | ||
) | ||
|
||
# Some things for a status change to affect | ||
def rfc_for_status_change_test_factory(name,rfc_num,std_level_id): | ||
target_rfc = Document.objects.create(name=name, type_id='draft', std_level_id=std_level_id, notify="%[email protected]"%name) | ||
target_rfc.set_state(State.objects.get(slug='rfc',type__slug='draft')) | ||
DocAlias.objects.create(name=name).docs.add(target_rfc) | ||
DocAlias.objects.create(name='rfc%d'%rfc_num).docs.add(target_rfc) | ||
target_rfc = WgRfcFactory(rfc_number=rfc_num, std_level_id=std_level_id) | ||
source_draft = WgDraftFactory(name=name, states=[("draft","rfc")], notify=f"{name}@ietf.org") | ||
source_draft.relateddocument_set.create(relationship_id="became_rfc", target=target_rfc) | ||
return target_rfc | ||
rfc_for_status_change_test_factory('draft-ietf-random-thing',9999,'ps') | ||
rfc_for_status_change_test_factory('draft-ietf-random-otherthing',9998,'inf') | ||
|