Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #480 from edx-solutions/rc/2015-08-13
Browse files Browse the repository at this point in the history
Rc/2015 08 13
  • Loading branch information
Fred Smith committed Sep 1, 2015
2 parents 4dc9694 + 83daf27 commit 0b838b3
Show file tree
Hide file tree
Showing 33 changed files with 8,137 additions and 6,822 deletions.
2 changes: 1 addition & 1 deletion cms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@
'open-edx.studio.announcements.*': '/courses/{course_id}/announcements',
'open-edx.lms.leaderboard.*': '/courses/{course_id}/cohort',
'open-edx.lms.discussions.*': '/courses/{course_id}/discussion/{commentable_id}/threads/{thread_id}',
'open-edx.xblock.group-project.*': '/courses/{course_id}/group_work?seqid={activity_location}',
'open-edx.xblock.group-project.*': '/courses/{course_id}/group_work?actid={activity_location}',
}

# list all known channel providers
Expand Down
2 changes: 2 additions & 0 deletions common/djangoapps/terrain/stubs/tests/test_youtube_stub.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
class StubYouTubeServiceTest(unittest.TestCase):

def setUp(self):
super(StubYouTubeServiceTest, self).setUp()
self.server = StubYouTubeService()
self.url = "http://127.0.0.1:{0}/".format(self.server.port)
self.server.config['time_to_response'] = 0.0
Expand All @@ -19,6 +20,7 @@ def test_unused_url(self):
response = requests.get(self.url + 'unused_url')
self.assertEqual("Unused url", response.content)

@unittest.skip('Failing intermittently due to inconsistent responses from YT. See TE-871')
def test_video_url(self):
response = requests.get(
self.url + 'test_youtube/OEoXaMPEzfM?v=2&alt=jsonc&callback=callback_func'
Expand Down
3 changes: 2 additions & 1 deletion common/lib/xmodule/xmodule/modulestore/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def find_path_to_course():
# pull out the location names
chapter = path[1].name if n > 1 else None
section = path[2].name if n > 2 else None
vertical = path[3].name if n > 3 else None
# Figure out the position
position = None

Expand All @@ -104,4 +105,4 @@ def find_path_to_course():
position_list.append(str(child_locs.index(path[path_index + 1]) + 1))
position = "_".join(position_list)

return (course_id, chapter, section, position)
return (course_id, chapter, section, vertical, position, path[-1])
Original file line number Diff line number Diff line change
Expand Up @@ -1092,15 +1092,16 @@ def test_path_to_location(self, default_ms, num_finds, num_sends):

should_work = (
(self.problem_x1a_2,
(course_key, u"Chapter_x", u"Sequential_x1", '1')),
(course_key, u"Chapter_x", u"Sequential_x1", u'Vertical_x1a', '1', self.problem_x1a_2)),
(self.chapter_x,
(course_key, "Chapter_x", None, None)),
(course_key, "Chapter_x", None, None, None, self.chapter_x)),
)

for location, expected in should_work:
# each iteration has different find count, pop this iter's find count
with check_mongo_calls(num_finds.pop(0), num_sends):
self.assertEqual(path_to_location(self.store, location), expected)
path = path_to_location(self.store, location)
self.assertEqual(path, expected)

not_found = (
course_key.make_usage_key('video', 'WelcomeX'),
Expand Down Expand Up @@ -1130,11 +1131,13 @@ def test_xml_path_to_location(self):
# only needs course_locations set
self.initdb('draft')
course_key = self.course_locations[self.XML_COURSEID1].course_key
video_key = course_key.make_usage_key('video', 'Welcome')
chapter_key = course_key.make_usage_key('chapter', 'Overview')
should_work = (
(course_key.make_usage_key('video', 'Welcome'),
(course_key, "Overview", "Welcome", None)),
(course_key.make_usage_key('chapter', 'Overview'),
(course_key, "Overview", None, None)),
(video_key,
(course_key, "Overview", "Welcome", None, None, video_key)),
(chapter_key,
(course_key, "Overview", None, None, None, chapter_key)),
)

for location, expected in should_work:
Expand Down
10 changes: 5 additions & 5 deletions common/lib/xmodule/xmodule/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
from django.conf import settings

import types
import edx_notifications.lib.publisher as notifications_publisher_lib
import edx_notifications.lib.consumer as notifications_consumer_lib

from xmodule.modulestore.django import modulestore


class SettingsService(object):
Expand Down Expand Up @@ -100,6 +96,9 @@ def __init__(self):
Class initializer, which just inspects the libraries and exposes the same functions
as a direct pass through
"""
# Avoids chicken-and-egg problem during tests.
import edx_notifications.lib.publisher as notifications_publisher_lib
import edx_notifications.lib.consumer as notifications_consumer_lib

self._bind_to_module_functions(notifications_publisher_lib)
self._bind_to_module_functions(notifications_consumer_lib)
Expand Down Expand Up @@ -135,7 +134,8 @@ def get_parent_info(self, module):
"""
Returns the location and display name of the parent
"""

# Avoids chicken-and-egg problem during tests.
from xmodule.modulestore.django import modulestore
parent_location = modulestore().get_parent_location(module)
parent_module = modulestore().get_item(parent_location)

Expand Down
2 changes: 1 addition & 1 deletion common/test/acceptance/pages/lms/discussion.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ def expand(self):
).fulfill()

def is_thread_anonymous(self):
return not self.q(css=".posted-details > .username").present
return not self.q(css=".posted-details > .username-wrapper > .username").present


class DiscussionUserProfilePage(CoursePage):
Expand Down
2 changes: 1 addition & 1 deletion common/test/acceptance/pages/lms/instructor_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def _get_messages(self, title_css, details_css, wait_for_messages=False):
"""
if wait_for_messages:
EmptyPromise(
lambda: self.q(css=self._bounded_selector(title_css)).results != 0,
lambda: len(self.q(css=self._bounded_selector(title_css)).results) != 0,
"Waiting for messages to appear"
).fulfill()
message_title = self.q(css=self._bounded_selector(title_css))
Expand Down
1 change: 0 additions & 1 deletion common/test/db_cache/bok_choy_data.json

This file was deleted.

Loading

0 comments on commit 0b838b3

Please sign in to comment.