Commit 51216748 by solashirai Committed by solashirai

quality fixes

parent 9dd604ee
......@@ -8,17 +8,15 @@ from nose.plugins.attrib import attr
from django.core.urlresolvers import reverse
from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase
from xmodule.modulestore.tests.django_utils import SharedModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
from lms.djangoapps.courseware.tests.helpers import LoginEnrollmentTestCase
from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory
from lms.djangoapps.lms_xblock.runtime import quote_slashes
from django.conf import settings
from django.core.urlresolvers import reverse
class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
"""
......@@ -84,7 +82,8 @@ class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
xblock_name = TestCrowdsourceHinter.XBLOCK_NAMES[0]
return reverse('xblock_handler', kwargs={
'course_id': self.course.id.to_deprecated_string(),
'usage_id': quote_slashes(self.course.id.make_usage_key('crowdsourcehinter', xblock_name).to_deprecated_string()),
'usage_id': quote_slashes(self.course.id.make_usage_key('crowdsourcehinter', xblock_name).
to_deprecated_string()),
'handler': handler,
'suffix': ''
})
......@@ -137,6 +136,7 @@ class TestCrowdsourceHinter(SharedModuleStoreTestCase, LoginEnrollmentTestCase):
self.assertEqual(resp[resp_key], resp_val)
self.assert_request_status_code(200, self.course_url)
@attr('shard_1')
class TestHinterFunctions(TestCrowdsourceHinter):
"""
......@@ -161,7 +161,7 @@ class TestHinterFunctions(TestCrowdsourceHinter):
data = {'new_hint_submission': 'new hint for answer 1', 'answer': 'incorrect answer 1'}
self.call_event('get_hint', {'submittedanswer': 'ans=incorrect+answer+1'})
result = self.call_event('add_new_hint', data)
expected = {'success':True,
expected = {'success': True,
'result': 'Hint added'}
self.assertEqual(json.loads(result.content), expected)
......
......@@ -4,7 +4,7 @@ Javascript tests for the crowdsourcehinter xblock
from textwrap import dedent
from common.test.acceptance.fixtures.course import CourseFixture, XBlockFixtureDesc
from common.test.acceptance.pages.lms.courseware import CoursewarePage
from openedx.tests.xblock_integration.pages.crowdsourcehinter_problem import CrowdsourcehinterProblemPage
from pages.crowdsourcehinter_problem import CrowdsourcehinterProblemPage
from common.test.acceptance.pages.studio.auto_auth import AutoAuthPage
from common.test.acceptance.tests.helpers import UniqueCourseTest
......@@ -59,6 +59,9 @@ class CrowdsourcehinterProblemTest(UniqueCourseTest):
course_id=self.course_id, staff=False).visit()
def _goto_csh_problem_page(self):
"""
Visit the page courseware page containing the hinter
"""
self.courseware_page.visit()
csh_problem_page = CrowdsourcehinterProblemPage(self.browser)
self.assertGreater(len(self.browser.find_elements_by_class_name('crowdsourcehinter_block')), 0)
......
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