Skip to content

Commit

Permalink
Fix test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
ankitjavalkar committed Oct 13, 2015
1 parent bc5fc32 commit 5061c2a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
script:
- test $DJANGO=1.5.7 && nosetests ./yaksh/evaluator_tests/
- python manage.py test yaksh
17 changes: 8 additions & 9 deletions yaksh/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down Expand Up @@ -51,10 +52,6 @@ def test_user_profile(self):
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,
Expand Down Expand Up @@ -130,8 +127,10 @@ def setUp(self):

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')
Expand Down

0 comments on commit 5061c2a

Please sign in to comment.