def test_paper_review_scale_ratings(db, dummy_paper, dummy_event, dummy_user, value, scale_min, scale_max, expected): from indico.modules.events.papers.controllers.management import RHManageReviewingSettings paper_reviewing_settings.set(dummy_event, 'scale_lower', -3) paper_reviewing_settings.set(dummy_event, 'scale_upper', 3) question = PaperReviewQuestion(type=PaperReviewType.content, field_type='rating', title='Rating') dummy_event.paper_review_questions.append(question) revision = PaperRevision(submitter=dummy_user, paper=dummy_paper) review = PaperReview(type=PaperReviewType.content, user=dummy_user, proposed_action=PaperAction.accept) revision.reviews.append(review) rating = PaperReviewRating(question=question, value=value) review.ratings.append(rating) db.session.flush() rh = RHManageReviewingSettings() rh.event = dummy_event rh._scale_ratings(scale_min, scale_max) assert rating.value == expected
def close(self): paper_reviewing_settings.set(self.event, 'end_dt', now_utc(False))
def open(self): if self.has_ended: paper_reviewing_settings.set(self.event, 'end_dt', None) else: paper_reviewing_settings.set(self.event, 'start_dt', now_utc(False))
def close(self): paper_reviewing_settings.set(self.event, 'end_dt', now_utc(False))
def open(self): if self.has_ended: paper_reviewing_settings.set(self.event, 'end_dt', None) else: paper_reviewing_settings.set(self.event, 'start_dt', now_utc(False))