def test_unicode(self): exam1 = factories.ExamFactory(course=self.course, description="hello", flow_id="exam-1") exam2 = factories.ExamFactory(course=self.course, description="exam", flow_id="exam-1") self.assertNotEqual(str(exam1), str(exam2))
def setUp(self): super(ExamTicketTest, self).setUp() self.exam = factories.ExamFactory(course=self.course) self.user1 = factories.UserFactory() self.participation1 = factories.ParticipationFactory( course=self.course, user=self.user1) self.user2 = factories.UserFactory() self.participation2 = factories.ParticipationFactory( course=self.course, user=self.user2)
def test_participation_not_match(self): another_exam = factories.ExamFactory(course=factories.CourseFactory( identifier="another-course")) resp = self.post_issue_exam_ticket_view(data=self.get_post_data( exam=another_exam.pk)) self.assertFormErrorLoose(resp, None) self.assertEqual(resp.status_code, 200) self.assertEqual(ExamTicket.objects.count(), 0) self.assertAddMessageCallCount(1) self.assertAddMessageCalledWith("User is not enrolled in course.")
def setUp(self): self.exam = factories.ExamFactory(course=self.course1)
def test_exam(self): factories.ExamFactory(course=self.course1) self.navigate_admin_view_by_model(models.Exam)
def setUpTestData(cls): # noqa super(ExamTestMixin, cls).setUpTestData() cls.add_user_permission(cls.instructor_participation.user, "can_issue_exam_tickets", model=ExamTicket) cls.exam = factories.ExamFactory(course=cls.course)