summaryrefslogtreecommitdiff
path: root/yaksh/test_views.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2016-12-03 15:10:56 +0530
committerGitHub2016-12-03 15:10:56 +0530
commitf416da9901ebca437c100bb80511eb87544f709d (patch)
treed63c7ce7e5f6d1c97d401d317a5211837fb011aa /yaksh/test_views.py
parent7fab5de07a05cf8f84e7beb8b4c166c0398172be (diff)
parentf76c6c7aab4df2f743259334aa91ca295cb854ee (diff)
downloadonline_test-f416da9901ebca437c100bb80511eb87544f709d.tar.gz
online_test-f416da9901ebca437c100bb80511eb87544f709d.tar.bz2
online_test-f416da9901ebca437c100bb80511eb87544f709d.zip
Merge pull request #161 from adityacp/quiz_instructions_editable
Quiz instructions editable
Diffstat (limited to 'yaksh/test_views.py')
-rw-r--r--yaksh/test_views.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/yaksh/test_views.py b/yaksh/test_views.py
index 2b7ad9b..30ebcaa 100644
--- a/yaksh/test_views.py
+++ b/yaksh/test_views.py
@@ -1,6 +1,6 @@
from datetime import datetime
import pytz
-
+import os
from django.contrib.auth.models import Group
from django.core.urlresolvers import reverse
from django.test import TestCase
@@ -146,7 +146,9 @@ class TestAddQuiz(TestCase):
self.mod_group = Group.objects.create(name='moderator')
tzone = pytz.timezone('UTC')
-
+ file_path = os.path.join(os.getcwd(), "Quiz_instructions.txt")
+ with open(file_path, 'r') as file:
+ self.file_data = file.read()
# Create Moderator with profile
self.user_plaintext_pass = 'demo'
self.user = User.objects.create_user(
@@ -185,7 +187,7 @@ class TestAddQuiz(TestCase):
self.pre_req_quiz = Quiz.objects.create(
start_date_time=datetime(2014, 2, 1, 5, 8, 15, 0, tzone),
end_date_time=datetime(2015, 10, 9, 10, 8, 15, 0, tzone),
- duration=30, active=True,
+ duration=30, active=True, instructions=self.file_data,
attempts_allowed=-1, time_between_attempts=0,
description='pre requisite quiz', pass_criteria=40,
language='Python', prerequisite=None,
@@ -195,7 +197,7 @@ class TestAddQuiz(TestCase):
self.quiz = Quiz.objects.create(
start_date_time=datetime(2014, 10, 9, 10, 8, 15, 0, tzone),
end_date_time=datetime(2015, 10, 9, 10, 8, 15, 0, tzone),
- duration=30, active=True,
+ duration=30, active=True, instructions=self.file_data,
attempts_allowed=-1, time_between_attempts=0,
description='demo quiz', pass_criteria=40,
language='Python', prerequisite=self.pre_req_quiz,
@@ -272,6 +274,7 @@ class TestAddQuiz(TestCase):
'description': 'updated demo quiz',
'pass_criteria': 40,
'language': 'java',
+ 'instructions': self.file_data,
'prerequisite': self.pre_req_quiz.id,
'course': self.course.id
}
@@ -318,6 +321,7 @@ class TestAddQuiz(TestCase):
'description': 'new demo quiz',
'pass_criteria': 50,
'language': 'python',
+ 'instructions': self.file_data,
'prerequisite': self.pre_req_quiz.id,
'course': self.course.id
}