コード例 #1
0
ファイル: tests.py プロジェクト: willingc/callisto-core
 def test_question_can_not_have_eval_field(self):
     page = QuestionPage.objects.create()
     rfi = SingleLineText(text="This is a question", page=page)
     rfi.save()
     self.assertRaises(
         ObjectDoesNotExist,
         lambda: SingleLineText.objects.first().evaluationfield)
コード例 #2
0
ファイル: tests.py プロジェクト: compwron/callisto-core
 def test_question_can_have_eval_field(self):
     page = QuestionPage.objects.create()
     rfi = SingleLineText(text="This is a question", page=page)
     rfi.save()
     EvaluationField.objects.create(question=rfi)
     self.assertIsNotNone(EvaluationField.objects.first().question)
     self.assertIsNotNone(SingleLineText.objects.first().evaluationfield)
     self.assertEqual(SingleLineText.objects.first().evaluationfield, EvaluationField.objects.first())
コード例 #3
0
ファイル: tests.py プロジェクト: willingc/callisto-core
 def test_question_can_have_eval_field(self):
     page = QuestionPage.objects.create()
     rfi = SingleLineText(text="This is a question", page=page)
     rfi.save()
     EvaluationField.objects.create(question=rfi)
     self.assertIsNotNone(EvaluationField.objects.first().question)
     self.assertIsNotNone(SingleLineText.objects.first().evaluationfield)
     self.assertEqual(SingleLineText.objects.first().evaluationfield,
                      EvaluationField.objects.first())
コード例 #4
0
ファイル: tests.py プロジェクト: willingc/callisto-core
 def test_evalfield_label_is_non_unique(self):
     page = QuestionPage.objects.create()
     q1 = SingleLineText(text="This is a question", page=page)
     q1.save()
     EvaluationField.objects.create(question=q1, label="question")
     q2 = SingleLineText(text="This is also a question", page=page)
     q2.save()
     EvaluationField.objects.create(question=q2, label="question")
     self.assertEqual(EvaluationField.objects.all().count(), 2)
コード例 #5
0
ファイル: tests.py プロジェクト: compwron/callisto-core
 def test_evalfield_label_is_non_unique(self):
     page = QuestionPage.objects.create()
     q1 = SingleLineText(text="This is a question", page=page)
     q1.save()
     EvaluationField.objects.create(question=q1, label="question")
     q2 = SingleLineText(text="This is also a question", page=page)
     q2.save()
     EvaluationField.objects.create(question=q2, label="question")
     self.assertEqual(EvaluationField.objects.all().count(), 2)
コード例 #6
0
ファイル: tests.py プロジェクト: compwron/callisto-core
 def test_question_can_not_have_eval_field(self):
     page = QuestionPage.objects.create()
     rfi = SingleLineText(text="This is a question", page=page)
     rfi.save()
     self.assertRaises(ObjectDoesNotExist, lambda: SingleLineText.objects.first().evaluationfield)