diff options
Diffstat (limited to 'yaksh')
-rw-r--r-- | yaksh/models.py | 2 | ||||
-rw-r--r-- | yaksh/test_models.py | 5 | ||||
-rw-r--r-- | yaksh/tests/test_code_server.py | 8 |
3 files changed, 5 insertions, 10 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index 5d072fd..b54e6a0 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -327,7 +327,7 @@ class Question(models.Model): for tc in self.testcase_set.all(): test_case_type = tc.type test_case_ctype = ContentType.objects.get(app_label="yaksh", - model=self.test_case_type + model=test_case_type ) test_case = test_case_ctype.get_object_for_this_type( question=self, diff --git a/yaksh/test_models.py b/yaksh/test_models.py index e95528b..48dfb8e 100644 --- a/yaksh/test_models.py +++ b/yaksh/test_models.py @@ -98,7 +98,6 @@ class QuestionTestCases(unittest.TestCase): language='Python', type='Code', active=True, - test_case_type='standardtestcase', description='Write a function', points=1.0, snippet='def myfunc()', @@ -111,7 +110,6 @@ class QuestionTestCases(unittest.TestCase): type='code', active=True, description='factorial of a no', - test_case_type='standardtestcase', points=2.0, snippet='def fact()', user=self.user2 @@ -196,7 +194,6 @@ class QuestionTestCases(unittest.TestCase): self.assertEqual(self.question2.points, q['points']) self.assertTrue(self.question2.active) self.assertEqual(self.question2.snippet, q['snippet']) - self.assertEqual(self.question2.test_case_type, q['test_case_type']) self.assertEqual(os.path.basename(que_file.file.path), q['files'][0][0]) self.assertEqual([case.get_field_value() for case in test_case], q['testcase']) for file in zip_file.namelist(): @@ -861,7 +858,6 @@ class TestCaseTestCases(unittest.TestCase): active=True, description='Write a function', points=1.0, - test_case_type="standardtestcase", user=self.user, snippet='def myfunc()' ) @@ -871,7 +867,6 @@ class TestCaseTestCases(unittest.TestCase): active=True, description='Write to standard output', points=1.0, - test_case_type="stdiobasedtestcase", user=self.user, snippet='def myfunc()' ) diff --git a/yaksh/tests/test_code_server.py b/yaksh/tests/test_code_server.py index 19698a5..47c1da7 100644 --- a/yaksh/tests/test_code_server.py +++ b/yaksh/tests/test_code_server.py @@ -49,7 +49,7 @@ class TestCodeServer(unittest.TestCase): # When result = self.code_server.run_code( - 'python', 'standardtestcase', json.dumps(testdata), '' + 'python', json.dumps(testdata), '' ) # Then @@ -71,7 +71,7 @@ class TestCodeServer(unittest.TestCase): # When result = self.code_server.run_code( - 'python', 'standardtestcase', json.dumps(testdata), '' + 'python', json.dumps(testdata), '' ) # Then @@ -92,7 +92,7 @@ class TestCodeServer(unittest.TestCase): # When result = self.code_server.run_code( - 'python', 'standardtestcase', json.dumps(testdata), '' + 'python', json.dumps(testdata), '' ) # Then @@ -116,7 +116,7 @@ class TestCodeServer(unittest.TestCase): }] } result = self.code_server.run_code( - 'python', 'standardtestcase', json.dumps(testdata), '' + 'python', json.dumps(testdata), '' ) results.put(json.loads(result)) |