diff --git a/submissions/factories.py b/submissions/factories.py index 9eb4eb4f24ca9edd3e2745605ea0b0d3f321479e..39aab654c692e00a6518a5e7ecc633acf1b59f99 100644 --- a/submissions/factories.py +++ b/submissions/factories.py @@ -38,7 +38,7 @@ class SubmissionFactory(factory.django.DjangoModelFactory): '''Fill empty arxiv fields.''' self.arxiv_link = 'https://arxiv.org/abs/%s' % self.arxiv_identifier_wo_vn_nr self.arxiv_identifier_w_vn_nr = '%sv1' % self.arxiv_identifier_wo_vn_nr - self.arxiv_vn_nr = 1 + self.arxiv_vn_nr = kwargs.get('arxiv_vn_nr', 1) @factory.post_generation def contributors(self, create, extracted, **kwargs): diff --git a/submissions/test_views.py b/submissions/test_views.py index 2d05701eb185fbd40ed0219d7d8e014f8c11efe9..11e9c210a19bd604c2791a96a4359d6f1c7672b4 100644 --- a/submissions/test_views.py +++ b/submissions/test_views.py @@ -223,6 +223,17 @@ class SubmissionListTest(BaseContributorTestCase): visible_submission_ids.append(EICassignedSubmissionFactory.create().id) visible_submission_ids.append(PublishedSubmissionFactory.create().id) + # Extra submission with multiple versions where the newest is publicly visible + # again. Earlier versions should therefore be invisible! + arxiv_id_resubmission = random_arxiv_identifier_without_version_number() + ResubmittedSubmissionFactory.create(arxiv_identifier_wo_vn_nr=arxiv_id_resubmission) + visible_submission_ids.append( + EICassignedSubmissionFactory.create( + arxiv_identifier_wo_vn_nr=arxiv_id_resubmission, + fill_arxiv_fields__arxiv_vn_nr=2 + ).id + ) + # Check with hardcoded URL as this url shouldn't change! client = Client() response = client.get('/submissions/')