From dadd413be83c9e9d566954d92441315a46c10944 Mon Sep 17 00:00:00 2001 From: Jorran de Wit <jorrandewit@outlook.com> Date: Sun, 29 Jan 2017 14:10:27 +0100 Subject: [PATCH] Quick PEP improvements --- commentaries/models.py | 12 ++++++------ commentaries/test_forms.py | 2 +- commentaries/tests.py | 3 --- 3 files changed, 7 insertions(+), 10 deletions(-) delete mode 100644 commentaries/tests.py diff --git a/commentaries/models.py b/commentaries/models.py index 903ed6469..188b2f33d 100644 --- a/commentaries/models.py +++ b/commentaries/models.py @@ -1,9 +1,8 @@ -from django.utils import timezone from django.db import models from django.contrib.postgres.fields import JSONField from django.template import Template, Context -from journals.models import SCIPOST_JOURNALS_DOMAINS, SCIPOST_JOURNALS_SPECIALIZATIONS +from journals.models import SCIPOST_JOURNALS_DOMAINS from scipost.models import TimeStampedModel, Contributor from scipost.constants import SCIPOST_DISCIPLINES, SCIPOST_SUBJECT_AREAS @@ -20,6 +19,7 @@ class CommentaryManager(models.Manager): def awaiting_vetting(self, **kwargs): return self.filter(vetted=False, **kwargs) + class Commentary(TimeStampedModel): """ A Commentary contains all the contents of a SciPost Commentary page for a given publication. @@ -126,8 +126,8 @@ class Commentary(TimeStampedModel): 'author_list': self.author_list, 'latest_activity': self.latest_activity.strftime('%Y-%m-%d %H:%M')}) header = ('<li>' - #'<div class="flex-container">' - #'<div class="flex-whitebox0">' + # '<div class="flex-container">' + # '<div class="flex-whitebox0">' '<p><a href="{{ scipost_url }}" ' 'class="pubtitleli">{{ pub_title }}</a></p>' '<p>by {{ author_list }}') @@ -144,7 +144,7 @@ class Commentary(TimeStampedModel): header += '<p> (published {{ pub_date }}) - ' context['pub_date'] = str(self.pub_date) header += ('latest activity: {{ latest_activity }}</p>' - #'</div></div>' + # '</div></div>' '</li>') template = Template(header) @@ -179,7 +179,7 @@ class Commentary(TimeStampedModel): elif self.arxiv_identifier: self.arxiv_or_DOI_string = 'arXiv:' + self.arxiv_identifier self.arxiv_link = 'http://arxiv.org/abs/' + self.arxiv_identifier - else: # should never come here + else: # should never come here pass self.save() diff --git a/commentaries/test_forms.py b/commentaries/test_forms.py index bd41e58a1..4f2035796 100644 --- a/commentaries/test_forms.py +++ b/commentaries/test_forms.py @@ -60,7 +60,7 @@ class TestVetCommentaryForm(TestCase): self.assertFalse(Commentary.objects.awaiting_vetting().exists()) # Refusal choice is ok - refusal_reason_inserted = VetCommentaryForm.COMMENTARY_REFUSAL_DICT[\ + refusal_reason_inserted = VetCommentaryForm.COMMENTARY_REFUSAL_DICT[ VetCommentaryForm.REFUSAL_UNTRACEBLE] self.assertEqual(form.get_refusal_reason(), refusal_reason_inserted) diff --git a/commentaries/tests.py b/commentaries/tests.py deleted file mode 100644 index 7ce503c2d..000000000 --- a/commentaries/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. -- GitLab