summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoradityacp2016-04-15 12:37:59 +0530
committeradityacp2016-05-04 22:47:34 +0530
commitb74128df59de974032d630a267a15e7d0c91a593 (patch)
treee019d9d62216510379cb4869412ff8e757b78a96
parent7a4438b7572f828c88958c12b2cd9666784f1bb5 (diff)
downloadonline_test-b74128df59de974032d630a267a15e7d0c91a593.tar.gz
online_test-b74128df59de974032d630a267a15e7d0c91a593.tar.bz2
online_test-b74128df59de974032d630a267a15e7d0c91a593.zip
models testcase changes
-rw-r--r--yaksh/tests.py8
-rw-r--r--yaksh/urls.py1
2 files changed, 5 insertions, 4 deletions
diff --git a/yaksh/tests.py b/yaksh/tests.py
index d3ff4fc..de9b39e 100644
--- a/yaksh/tests.py
+++ b/yaksh/tests.py
@@ -27,7 +27,7 @@ def setUpModule():
# create 20 questions
for i in range(1, 21):
- Question.objects.create(summary='Q%d' % (i), points=1, type='code')
+ Question.objects.create(summary='Q%d' % (i), points=1, type='code', user=user)
# create a quiz
quiz = Quiz.objects.create(start_date_time=datetime(2015, 10, 9, 10, 8, 15, 0),
@@ -72,10 +72,11 @@ class ProfileTestCases(unittest.TestCase):
class QuestionTestCases(unittest.TestCase):
def setUp(self):
# Single question details
+ self.user = User.objects.get(pk=1)
self.question = Question(summary='Demo question', language='Python',
type='Code', active=True,
description='Write a function', points=1.0,
- snippet='def myfunc()')
+ snippet='def myfunc()', user=self.user)
self.question.save()
self.question.tags.add('python', 'function')
self.testcase = TestCase(question=self.question,
@@ -121,10 +122,11 @@ class QuestionTestCases(unittest.TestCase):
###############################################################################
class TestCaseTestCases(unittest.TestCase):
def setUp(self):
+ self.user = User.objects.get(pk=1)
self.question = Question(summary='Demo question', language='Python',
type='Code', active=True,
description='Write a function', points=1.0,
- snippet='def myfunc()')
+ snippet='def myfunc()', user=self.user)
self.question.save()
self.testcase = TestCase(question=self.question,
func_name='def myfunc', kw_args='a=10,b=11',
diff --git a/yaksh/urls.py b/yaksh/urls.py
index 4e72084..533a6f9 100644
--- a/yaksh/urls.py
+++ b/yaksh/urls.py
@@ -74,7 +74,6 @@ urlpatterns += [
views.enroll, {'was_rejected': True}),
url(r'manage/reject/(?P<course_id>\d+)/(?P<user_id>\d+)/$', views.reject),
url(r'manage/enrolled/reject/(?P<course_id>\d+)/(?P<user_id>\d+)/$',
-
views.reject, {'was_enrolled': True}),
url(r'manage/toggle_status/(?P<course_id>\d+)/$', views.toggle_course_status),
url(r'^ajax/questionpaper/(?P<query>.+)/$', views.ajax_questionpaper),