summaryrefslogtreecommitdiff
path: root/yaksh
diff options
context:
space:
mode:
Diffstat (limited to 'yaksh')
-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),