diff --git a/ietf/submit/forms.py b/ietf/submit/forms.py index b29669a0f1..c2f99975b2 100644 --- a/ietf/submit/forms.py +++ b/ietf/submit/forms.py @@ -707,7 +707,7 @@ def clean(self): elif alias.document.get_state_slug() == "rfc": self.add_error( 'replaces', - forms.ValidationError("An Internet-Draft cannot replace an RFC"), + forms.ValidationError("An Internet-Draft cannot replace another Internet-Draft that has become an RFC"), ) elif alias.document.get_state_slug('draft-iesg') in ('approved', 'ann', 'rfcqueue'): self.add_error( diff --git a/ietf/submit/tests.py b/ietf/submit/tests.py index 6eeaa47c56..17bf178199 100644 --- a/ietf/submit/tests.py +++ b/ietf/submit/tests.py @@ -3099,13 +3099,15 @@ 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()) form = SubmissionAutoUploadForm( request_factory.get('/some/url'), - data={'user': auth.user.username, 'replaces': rfc.name}, + data={'user': auth.user.username, 'replaces': draft.name}, files=files_dict, ) self.assertFalse(form.is_valid()) - self.assertIn('An Internet-Draft cannot replace an RFC', form.errors['replaces']) + self.assertIn('An Internet-Draft cannot replace another Internet-Draft that has become an RFC', form.errors['replaces']) # can't replace draft approved by iesg existing_drafts[0].set_state(State.objects.get(type='draft-iesg', slug='approved'))