Added more unit tests

This commit is contained in:
2013-08-25 21:51:54 +10:00
parent b2f436907a
commit 3c5edd61b1

View File

@@ -81,3 +81,10 @@ class ModelsTest(TestCase):
question=testquestion)
result = ajax.check_answer(None, testanswer.id, testquestion.id)
self.assertEqual('{"result": false}', result)
def test_ajax_check_answer_incorrect(self):
testquestion = Question.objects.create(text="Test", sample_id=1)
testanswer = Answer.objects.create(text="Test", correct=True,
question=testquestion)
result = ajax.check_answer(None, testanswer.id + 1, testquestion.id)
self.assertEqual('{"result": false}', result)