Added more unit tests
This commit is contained in:
parent
b2f436907a
commit
3c5edd61b1
1 changed files with 7 additions and 0 deletions
|
|
@ -81,3 +81,10 @@ class ModelsTest(TestCase):
|
||||||
question=testquestion)
|
question=testquestion)
|
||||||
result = ajax.check_answer(None, testanswer.id, testquestion.id)
|
result = ajax.check_answer(None, testanswer.id, testquestion.id)
|
||||||
self.assertEqual('{"result": false}', result)
|
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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue