Commit 3b657d6d by Brian Wilson

Disable randomized-problem test until bug-fix is merged in.

parent 9c1881e5
......@@ -11,6 +11,7 @@ from courseware.tests.tests import TEST_DATA_MONGO_MODULESTORE
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory
class ProgressTestCase(TestCase):
def setUp(self):
......@@ -35,7 +36,7 @@ class ProgressTestCase(TestCase):
self.assertEqual(tabs._progress(self.tab, self.mockuser1, self.course,
self.active_page1)[0].link,
reverse('progress', args = [self.course.id]))
reverse('progress', args=[self.course.id]))
self.assertEqual(tabs._progress(self.tab, self.mockuser1, self.course,
self.active_page0)[0].is_active, False)
......@@ -129,14 +130,13 @@ class StaticTabTestCase(TestCase):
self.assertEqual(tabs._static_tab(self.tabby, self.user,
self.course, self.active_page1)[0].link,
reverse('static_tab', args = [self.course.id,
reverse('static_tab', args=[self.course.id,
self.tabby['url_slug']]))
self.assertEqual(tabs._static_tab(self.tabby, self.user,
self.course, self.active_page1)[0].is_active,
True)
self.assertEqual(tabs._static_tab(self.tabby, self.user,
self.course, self.active_page0)[0].is_active,
False)
......@@ -206,6 +206,7 @@ class TextbooksTestCase(TestCase):
self.assertEqual(tabs._textbooks(self.tab, self.mockuser0,
self.course, self.active_pageX), [])
class KeyCheckerTestCase(TestCase):
def setUp(self):
......@@ -225,37 +226,34 @@ class NullValidatorTestCase(TestCase):
def setUp(self):
self.d = {}
self.dummy = {}
def test_null_validator(self):
self.assertIsNone(tabs.null_validator(self.d))
self.assertIsNone(tabs.null_validator(self.dummy))
class ValidateTabsTestCase(TestCase):
def setUp(self):
self.courses = [MagicMock() for i in range(0,5)]
self.courses = [MagicMock() for i in range(0, 5)]
self.courses[0].tabs = None
self.courses[1].tabs = [{'type':'courseware'}, {'type': 'fax'}]
self.courses[1].tabs = [{'type': 'courseware'}, {'type': 'fax'}]
self.courses[2].tabs = [{'type':'shadow'}, {'type': 'course_info'}]
self.courses[2].tabs = [{'type': 'shadow'}, {'type': 'course_info'}]
self.courses[3].tabs = [{'type':'courseware'},{'type':'course_info', 'name': 'alice'},
{'type': 'wiki', 'name':'alice'}, {'type':'discussion', 'name': 'alice'},
{'type':'external_link', 'name': 'alice', 'link':'blink'},
{'type':'textbooks'}, {'type':'progress', 'name': 'alice'},
{'type':'static_tab', 'name':'alice', 'url_slug':'schlug'},
self.courses[3].tabs = [{'type': 'courseware'}, {'type': 'course_info', 'name': 'alice'},
{'type': 'wiki', 'name': 'alice'}, {'type': 'discussion', 'name': 'alice'},
{'type': 'external_link', 'name': 'alice', 'link': 'blink'},
{'type': 'textbooks'}, {'type': 'progress', 'name': 'alice'},
{'type': 'static_tab', 'name': 'alice', 'url_slug': 'schlug'},
{'type': 'staff_grading'}]
self.courses[4].tabs = [{'type':'courseware'},{'type': 'course_info'}, {'type': 'flying'}]
self.courses[4].tabs = [{'type': 'courseware'}, {'type': 'course_info'}, {'type': 'flying'}]
def test_validate_tabs(self):
self.assertIsNone(tabs.validate_tabs(self.courses[0]))
self.assertRaises(tabs.InvalidTabsException, tabs.validate_tabs, self.courses[1])
self.assertRaises(tabs.InvalidTabsException, tabs.validate_tabs, self.courses[2])
......@@ -268,15 +266,15 @@ class DiscussionLinkTestCase(ModuleStoreTestCase):
def setUp(self):
self.tabs_with_discussion = [
{'type':'courseware'},
{'type':'course_info'},
{'type':'discussion'},
{'type':'textbooks'},
{'type': 'courseware'},
{'type': 'course_info'},
{'type': 'discussion'},
{'type': 'textbooks'},
]
self.tabs_without_discussion = [
{'type':'courseware'},
{'type':'course_info'},
{'type':'textbooks'},
{'type': 'courseware'},
{'type': 'course_info'},
{'type': 'textbooks'},
]
@staticmethod
......
......@@ -5,7 +5,6 @@ import logging
import json
from mock import Mock, patch
import textwrap
import random
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
......@@ -69,12 +68,8 @@ class TestRegradingBase(LoginEnrollmentTestCase, ModuleStoreTestCase):
def get_user_email(username):
return '{0}@test.com'.format(username)
@staticmethod
def get_user_password(username):
return 'test'
def login_username(self, username):
self.login(TestRegradingBase.get_user_email(username), TestRegradingBase.get_user_password(username))
self.login(TestRegradingBase.get_user_email(username), "test")
self.current_user = username
def _create_user(self, username, is_staff=False):
......@@ -139,8 +134,7 @@ class TestRegradingBase(LoginEnrollmentTestCase, ModuleStoreTestCase):
self.login_username(username)
# make ajax call:
modx_url = reverse('modx_dispatch',
kwargs={
'course_id': self.course.id,
kwargs={'course_id': self.course.id,
'location': TestRegrading.problem_location(problem_url_name),
'dispatch': 'problem_get', })
resp = self.client.post(modx_url, {})
......@@ -163,8 +157,7 @@ class TestRegradingBase(LoginEnrollmentTestCase, ModuleStoreTestCase):
self.login_username(username)
# make ajax call:
modx_url = reverse('modx_dispatch',
kwargs={
'course_id': self.course.id,
kwargs={'course_id': self.course.id,
'location': TestRegrading.problem_location(problem_url_name),
'dispatch': 'problem_check', })
......@@ -196,8 +189,7 @@ class TestRegradingBase(LoginEnrollmentTestCase, ModuleStoreTestCase):
def show_correct_answer(self, problem_url_name):
modx_url = reverse('modx_dispatch',
kwargs={
'course_id': self.course.id,
kwargs={'course_id': self.course.id,
'location': TestRegradingBase.problem_location(problem_url_name),
'dispatch': 'problem_show', })
return self.client.post(modx_url, {})
......@@ -388,7 +380,7 @@ class TestRegrading(TestRegradingBase):
data=problem_xml,
metadata={"rerandomize": "per_student"})
def test_regrading_randomized_problem(self):
def WAITING_FOR_SAFEEXEC_FIX_test_regrading_randomized_problem(self):
"""Run regrade scenario on custom problem that uses randomize"""
# First define the custom response problem:
problem_url_name = 'H1P1'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment