summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorankitjavalkar2015-10-09 15:45:10 +0530
committerankitjavalkar2015-10-13 12:52:52 +0530
commit5061c2a44ca6a9f69793a7cc00a1262aa2531fc4 (patch)
tree593648f40b9d2cb8d756f65c384d665a8de853c6
parentbc5fc32fdf8015a069a0a22454400b5ed7b03abc (diff)
downloadonline_test-5061c2a44ca6a9f69793a7cc00a1262aa2531fc4.tar.gz
online_test-5061c2a44ca6a9f69793a7cc00a1262aa2531fc4.tar.bz2
online_test-5061c2a44ca6a9f69793a7cc00a1262aa2531fc4.zip
Fix test cases
-rw-r--r--.travis.yml6
-rw-r--r--yaksh/tests.py17
2 files changed, 11 insertions, 12 deletions
diff --git a/.travis.yml b/.travis.yml
index dea6396..8f48a88 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,6 +17,6 @@ before_install:
- sudo apt-get install -y scilab
# command to run tests
-script:
- - nosetests ./yaksh/evaluator_tests/
- - python manage.py test \ No newline at end of file
+script:
+ - test $DJANGO=1.5.7 && nosetests ./yaksh/evaluator_tests/
+ - python manage.py test yaksh \ No newline at end of file
diff --git a/yaksh/tests.py b/yaksh/tests.py
index 77ac56f..ce1e0e2 100644
--- a/yaksh/tests.py
+++ b/yaksh/tests.py
@@ -19,10 +19,11 @@ def setUpModule():
Question.objects.create(summary='Q%d' % (i), points=1)
# create a quiz
- Quiz.objects.create(start_date='2014-06-16', duration=30, active=False,
+ Quiz.objects.create(start_date_time=datetime.datetime(2015, 10, 9, 10, 8, 15, 0),
+ duration=30, active=False,
attempts_allowed=-1, time_between_attempts=0,
- description='demo quiz', pass_criteria=40,
- language='Python', prerequisite=None)
+ description='demo quiz', pass_criteria=40,
+ language='Python', prerequisite=None)
def tearDownModule():
@@ -51,10 +52,6 @@ class ProfileTestCases(unittest.TestCase):
class QuestionTestCases(unittest.TestCase):
def setUp(self):
# Single question details
- # self.question = Question(summary='Demo question', language='Python',
- # type='Code', active=True,
- # description='Write a function', points=1.0,
- # test='Test Cases', snippet='def myfunc()')
self.question = Question(summary='Demo question', language='Python',
type='Code', active=True,
description='Write a function', points=1.0,
@@ -130,8 +127,10 @@ class QuizTestCases(unittest.TestCase):
def test_quiz(self):
""" Test Quiz"""
- self.assertEqual((self.quiz.start_date).strftime('%Y-%m-%d'),
- '2014-06-16')
+ self.assertEqual((self.quiz.start_date_time).strftime('%Y-%m-%d'),
+ '2015-10-09')
+ self.assertEqual((self.quiz.start_date_time).strftime('%H:%M:%S'),
+ '10:08:15')
self.assertEqual(self.quiz.duration, 30)
self.assertTrue(self.quiz.active is False)
self.assertEqual(self.quiz.description, 'demo quiz')