summaryrefslogtreecommitdiff
path: root/yaksh/test_views.py
diff options
context:
space:
mode:
authorPrabhu Ramachandran2017-08-25 08:40:58 +0530
committerGitHub2017-08-25 08:40:58 +0530
commit9e0f737c25a5156aa884d27357af0aef1145c4b7 (patch)
tree53ad33f61c239271f62ee2054ad79cb76688645d /yaksh/test_views.py
parent9d5c4a01fd7856f1ef8793b75a9734324c254344 (diff)
parent30b48c30abebf75ed4b51fd034600e0c7d58c95b (diff)
downloadonline_test-9e0f737c25a5156aa884d27357af0aef1145c4b7.tar.gz
online_test-9e0f737c25a5156aa884d27357af0aef1145c4b7.tar.bz2
online_test-9e0f737c25a5156aa884d27357af0aef1145c4b7.zip
Merge pull request #312 from maheshgudi/yaml_questions
Yaml serialized questions
Diffstat (limited to 'yaksh/test_views.py')
-rw-r--r--yaksh/test_views.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/yaksh/test_views.py b/yaksh/test_views.py
index 8025ecf..064c39d 100644
--- a/yaksh/test_views.py
+++ b/yaksh/test_views.py
@@ -3141,7 +3141,7 @@ class TestShowQuestions(TestCase):
zip_file = string_io(response.content)
zipped_file = zipfile.ZipFile(zip_file, 'r')
self.assertIsNone(zipped_file.testzip())
- self.assertIn('questions_dump.json', zipped_file.namelist())
+ self.assertIn('questions_dump.yaml', zipped_file.namelist())
zip_file.close()
zipped_file.close()
@@ -3170,12 +3170,18 @@ class TestShowQuestions(TestCase):
data={'file': questions_file,
'upload': 'upload'}
)
+ summaries = ['Roots of quadratic equation', 'Print Output',
+ 'Adding decimals', 'For Loop over String',
+ 'Hello World in File', 'Extract columns from files',
+ 'Check Palindrome', 'Add 3 numbers', 'Reverse a string'
+ ]
+
uploaded_ques = Question.objects.filter(active=True,
- summary="Yaksh Demo Question",
+ summary__in=summaries,
user=self.user).count()
self.assertEqual(response.status_code, 200)
self.assertTemplateUsed(response, 'yaksh/showquestions.html')
- self.assertEqual(uploaded_ques, 3)
+ self.assertEqual(uploaded_ques, 9)
f.close()
dummy_file = SimpleUploadedFile("test.txt", b"test")
response = self.client.post(reverse('yaksh:show_questions'),