def test_failed(self): feedback = Mock() feedback.grade = 'Failed' feedback.is_passing_grade = False self.assertEquals( normalize_whitespace(BeautifulSoup(devilry_student_shortgrade(feedback)).text), 'Failed' )
def test_passed_with_grade(self): feedback = Mock() feedback.grade = 'A' feedback.is_passing_grade = True self.assertEquals( normalize_whitespace(BeautifulSoup(devilry_student_shortgrade(feedback)).text), 'A (Passed)' )
def test_delivery_render_after_deadline(self): groupbuilder = self.week1builder.add_group( examiners=[self.examiner1]) delivery = groupbuilder.add_deadline_in_x_weeks(weeks=1)\ .add_delivery_x_hours_after_deadline(hours=2).delivery response = self._getas('examiner1', groupbuilder.group.id) self.assertEquals(response.status_code, 200) html = response.content self.assertEquals( normalize_whitespace(cssGet(html, '.delivery .after_deadline_message').text), "2 hours after the deadline")
def test_after_deadline(self): delivery = self.week1builder\ .add_group(examiners=[self.examiner1])\ .add_deadline_x_weeks_ago(weeks=1)\ .add_delivery_x_hours_after_deadline(hours=1).delivery response = self._getas('examiner1', delivery.id) self.assertEquals(response.status_code, 200) html = response.content self.assertEquals( normalize_whitespace(cssGet(html, '.after_deadline_message').text), 'This delivery was added 1 hour after the deadline.The group has no other deliveries for this deadline.')
def test_after_deadline_other_deliveries(self): deadlinebuilder = self.week1builder\ .add_group(examiners=[self.examiner1])\ .add_deadline_x_weeks_ago(weeks=1) delivery1 = deadlinebuilder.add_delivery_x_hours_before_deadline(hours=1).delivery delivery2 = deadlinebuilder.add_delivery_x_hours_after_deadline(hours=4).delivery response = self._getas('examiner1', delivery2.id) self.assertEquals(response.status_code, 200) html = response.content self.assertEquals( normalize_whitespace(cssGet(html, '.after_deadline_message').text), 'This delivery was added 4 hours after the deadline.The group has made at least one more delivery for this deadline.Browse other deliveries.')