-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made it so that compliance_checks receives a parameter in order to de…
…termine whether and Article is being updated. If so, it treats articles published before 2023 normally rather than marking them as compliant.
- Loading branch information
1 parent
236aa07
commit 3103fe0
Showing
4 changed files
with
42 additions
and
23 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 |
---|---|---|
|
@@ -90,7 +90,7 @@ def test_create_article(self): | |
) | ||
self.article.related_licenses.add(self.license) | ||
self.article.save() | ||
compliance_checks(self.article.id) | ||
compliance_checks(self.article.id, False) | ||
|
||
article = Article.objects.get(id=self.article.id) | ||
report = article.report.first() | ||
|
@@ -108,21 +108,21 @@ def test_create_article_with_not_compliant_doi(self): | |
article_id=self.article_with_not_compliant_doi, | ||
) | ||
|
||
compliance_checks(self.article_with_not_compliant_doi.id) | ||
compliance_checks(self.article_with_not_compliant_doi.id, False) | ||
article = Article.objects.get(id=self.article_with_not_compliant_doi.id) | ||
report = article.report.first() | ||
|
||
self.assertEqual(report.check_doi_registration_time, False) | ||
|
||
def test_create_article_with_missing_compliant_doi(self): | ||
compliance_checks(self.article_with_not_compliant_doi.id) | ||
compliance_checks(self.article_with_not_compliant_doi.id, False) | ||
article = Article.objects.get(id=self.article_with_not_compliant_doi.id) | ||
report = article.report.first() | ||
|
||
self.assertEqual(report.check_doi_registration_time, False) | ||
|
||
def test_create_article_with_not_compliant_title(self): | ||
compliance_checks(self.article_with_not_compliant_title.id) | ||
compliance_checks(self.article_with_not_compliant_title.id, False) | ||
article = Article.objects.get(id=self.article_with_not_compliant_title.id) | ||
report = article.report.first() | ||
|
||
|
@@ -136,7 +136,7 @@ def test_create_article_with_not_compliant_file_format_no_publication_info(self) | |
filetype=file_format, | ||
) | ||
|
||
compliance_checks(self.article.id) | ||
compliance_checks(self.article.id, False) | ||
article = Article.objects.get(id=self.article.id) | ||
report = article.report.first() | ||
|
||
|
@@ -160,7 +160,7 @@ def test_create_article_with_compliant_file_format(self): | |
filetype=file_format, | ||
) | ||
|
||
compliance_checks(self.article.id) | ||
compliance_checks(self.article.id, False) | ||
article = Article.objects.get(id=self.article.id) | ||
report = article.report.first() | ||
self.assertEqual(report.check_required_file_formats, True) | ||
|
@@ -183,7 +183,7 @@ def test_create_article_with_not_compliant_file_format(self): | |
filetype=file_format, | ||
) | ||
|
||
compliance_checks(self.article.id) | ||
compliance_checks(self.article.id, False) | ||
article = Article.objects.get(id=self.article.id) | ||
report = article.report.first() | ||
self.assertEqual(report.check_required_file_formats, False) | ||
|
@@ -204,7 +204,7 @@ def test_create_article_with_not_compliant_arxiv_category(self): | |
category="eess-as", | ||
article_id=self.article, | ||
) | ||
compliance_checks(self.article.id) | ||
compliance_checks(self.article.id, False) | ||
article = Article.objects.get(id=self.article.id) | ||
report = article.report.first() | ||
self.assertEqual(report.check_arxiv_category, False) | ||
|
@@ -217,7 +217,7 @@ def test_create_author_with_no_affiliation(self): | |
email="[email protected]", | ||
author_order=100, | ||
) | ||
compliance_checks(self.article.id) | ||
compliance_checks(self.article.id, False) | ||
article = Article.objects.get(id=self.article.id) | ||
report = article.report.first() | ||
self.assertEqual(report.check_authors_affiliation, False) | ||
|
@@ -244,7 +244,7 @@ def test_create_author_with_affiliation(self): | |
) | ||
affiliation.author_id.set(author_id) | ||
|
||
compliance_checks(self.article.id) | ||
compliance_checks(self.article.id, False) | ||
article = Article.objects.get(id=self.article.id) | ||
report = article.report.first() | ||
self.assertEqual(report.check_authors_affiliation, True) | ||
|
@@ -267,19 +267,28 @@ def test_create_article_with_not_compliant_category_having_not_partial_journal( | |
category="hep-th", | ||
article_id=self.article, | ||
) | ||
compliance_checks(self.article.id) | ||
compliance_checks(self.article.id, False) | ||
article = Article.objects.get(id=self.article.id) | ||
report = article.report.first() | ||
self.assertEqual(report.check_arxiv_category, False) | ||
|
||
def test_create_article_published_before_2023(self): | ||
compliance_checks(self.article_published_before_2023.id) | ||
compliance_checks(self.article_published_before_2023.id, False) | ||
report = self.article_published_before_2023.report.first() | ||
|
||
self.assertEqual(report.compliant, True) | ||
|
||
def test_update_non_compliant_article_published_before_2023(self): | ||
compliance_checks(self.article_published_before_2023.id, False) | ||
report = self.article_published_before_2023.report.first() | ||
self.assertEqual(report.compliant, True) | ||
|
||
compliance_checks(self.article_published_before_2023.id, True) | ||
report = self.article_published_before_2023.report.first() | ||
self.assertEqual(report.compliant, False) | ||
|
||
def test_mark_article_with_reports_as_compliant(self): | ||
compliance_checks(self.article.id) | ||
compliance_checks(self.article.id, False) | ||
make_compliant(Article.objects.all()) | ||
report = self.article.report.first() | ||
|
||
|