summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMahesh Gudi2018-07-13 20:10:12 +0530
committerGitHub2018-07-13 20:10:12 +0530
commitd2f1328238f35373761686d3b405f4afbedfba7f (patch)
tree4e73b5f3a0efe95ba77a66b3520429514a1bd024
parentaaadd40f7ee0c3ab6e7da4e023257eb091f206bc (diff)
parent49544f71db2a9fc2f914cd56cb746514970ed98b (diff)
downloadonline_test-d2f1328238f35373761686d3b405f4afbedfba7f.tar.gz
online_test-d2f1328238f35373761686d3b405f4afbedfba7f.tar.bz2
online_test-d2f1328238f35373761686d3b405f4afbedfba7f.zip
Merge pull request #500 from maheshgudi/release-0.9
Update migrations to fix order error
-rw-r--r--yaksh/migrations/0013_release_0_9_0.py8
-rw-r--r--yaksh/models.py3
-rw-r--r--yaksh/test_models.py15
3 files changed, 1 insertions, 25 deletions
diff --git a/yaksh/migrations/0013_release_0_9_0.py b/yaksh/migrations/0013_release_0_9_0.py
index 3f7f377..f18070d 100644
--- a/yaksh/migrations/0013_release_0_9_0.py
+++ b/yaksh/migrations/0013_release_0_9_0.py
@@ -1,11 +1,10 @@
# -*- coding: utf-8 -*-
-# Generated by Django 1.10 on 2018-07-13 10:24
+# Generated by Django 1.10 on 2018-07-13 14:16
from __future__ import unicode_literals
from django.db import migrations, models
import yaksh.models
-
def set_is_moderator(apps, schema_editor):
""" Set is_moderator to True for all users that belong
to Moderator group """
@@ -17,7 +16,6 @@ def set_is_moderator(apps, schema_editor):
prof.is_moderator = True
prof.save()
-
class Migration(migrations.Migration):
dependencies = [
@@ -40,9 +38,5 @@ class Migration(migrations.Migration):
name='file',
field=models.FileField(default=None, upload_to=yaksh.models.get_file_dir),
),
- migrations.AlterUniqueTogether(
- name='testcaseorder',
- unique_together=set([('answer_paper', 'question', 'order')]),
- ),
migrations.RunPython(set_is_moderator),
]
diff --git a/yaksh/models.py b/yaksh/models.py
index 60b09c5..1e5492c 100644
--- a/yaksh/models.py
+++ b/yaksh/models.py
@@ -2397,7 +2397,4 @@ class TestCaseOrder(models.Model):
# Order of the test case for a question.
order = models.TextField()
- class Meta:
- unique_together = ("answer_paper", "question", "order")
-
##############################################################################
diff --git a/yaksh/test_models.py b/yaksh/test_models.py
index 14d5197..e0235fe 100644
--- a/yaksh/test_models.py
+++ b/yaksh/test_models.py
@@ -1285,21 +1285,6 @@ class AnswerPaperTestCases(unittest.TestCase):
self.assertEqual(self.answer.marks, 0)
self.assertFalse(self.answer.correct)
- def test_testcase_order(self):
- testcase_ids = ",".join([str(ids) for ids in
- self.question2.get_test_cases()
- ])
- testcase_order = TestCaseOrder.objects.create(
- answer_paper=self.answerpaper,
- question=self.question2,
- order=testcase_ids)
- with self.assertRaises(IntegrityError):
- TestCaseOrder.objects.create(answer_paper=self.answerpaper,
- question=self.question2,
- order=testcase_ids
- )
- testcase_order.delete()
-
def test_validate_and_regrade_mcq_correct_answer(self):
# Given
mcq_answer = str(self.mcq_based_testcase.id)