SciPost Code Repository

Skip to content
Snippets Groups Projects
Commit 3fab0622 authored by Jorran de Wit's avatar Jorran de Wit
Browse files

Extend submission listview tests

parent c1a463a0
No related branches found
No related tags found
No related merge requests found
...@@ -38,7 +38,7 @@ class SubmissionFactory(factory.django.DjangoModelFactory): ...@@ -38,7 +38,7 @@ class SubmissionFactory(factory.django.DjangoModelFactory):
'''Fill empty arxiv fields.''' '''Fill empty arxiv fields.'''
self.arxiv_link = 'https://arxiv.org/abs/%s' % self.arxiv_identifier_wo_vn_nr 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_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 @factory.post_generation
def contributors(self, create, extracted, **kwargs): def contributors(self, create, extracted, **kwargs):
......
...@@ -223,6 +223,17 @@ class SubmissionListTest(BaseContributorTestCase): ...@@ -223,6 +223,17 @@ class SubmissionListTest(BaseContributorTestCase):
visible_submission_ids.append(EICassignedSubmissionFactory.create().id) visible_submission_ids.append(EICassignedSubmissionFactory.create().id)
visible_submission_ids.append(PublishedSubmissionFactory.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! # Check with hardcoded URL as this url shouldn't change!
client = Client() client = Client()
response = client.get('/submissions/') response = client.get('/submissions/')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment