Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
a43cf589
Commit
a43cf589
authored
Jul 16, 2015
by
Davorin Sego
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update edx-search, fix lms filter generator and courseware index tests
parent
845e1d62
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
14 deletions
+10
-14
cms/djangoapps/contentstore/tests/test_courseware_index.py
+2
-3
common/test/acceptance/tests/lms/test_lms_cohorted_courseware_search.py
+2
-4
common/test/acceptance/tests/lms/test_lms_split_test_courseware_search.py
+2
-4
lms/lib/courseware_search/lms_filter_generator.py
+1
-1
lms/lib/courseware_search/test/test_lms_search_initializer.py
+2
-1
requirements/edx/github.txt
+1
-1
No files found.
cms/djangoapps/contentstore/tests/test_courseware_index.py
View file @
a43cf589
...
...
@@ -871,8 +871,7 @@ class TestLibrarySearchIndexer(MixedWithOptionsTestCase):
self
.
update_item
(
store
,
self
.
html_unit1
)
self
.
reindex_library
(
store
)
response
=
self
.
search
()
# TODO: MockSearchEngine never updates existing item: returns 3 items here - uncomment when it's fixed
# self.assertEqual(response["total"], 2)
self
.
assertEqual
(
response
[
"total"
],
2
)
html_contents
=
[
cont
[
'html_content'
]
for
cont
in
self
.
_get_contents
(
response
)]
self
.
assertIn
(
new_data
,
html_contents
)
...
...
@@ -1264,7 +1263,7 @@ class GroupConfigurationSearchMongo(CourseTestCase, MixedWithOptionsTestCase):
added_to_index
=
self
.
reindex_course
(
self
.
store
)
self
.
assertEqual
(
added_to_index
,
16
)
response
=
self
.
searcher
.
search
(
field_dictionary
=
{
"course"
:
unicode
(
self
.
course
.
id
)})
self
.
assertEqual
(
response
[
"total"
],
23
)
self
.
assertEqual
(
response
[
"total"
],
17
)
group_access_content
=
{
'group_access'
:
{
666
:
[
1
]}}
...
...
common/test/acceptance/tests/lms/test_lms_cohorted_courseware_search.py
View file @
a43cf589
...
...
@@ -4,6 +4,7 @@ Test courseware search
import
os
import
json
from
..helpers
import
remove_file
from
...pages.common.logout
import
LogoutPage
from
...pages.studio.overview
import
CourseOutlinePage
from
...pages.lms.courseware_search
import
CoursewareSearchPage
...
...
@@ -40,6 +41,7 @@ class CoursewareSearchCohortTest(ContainerBase):
# create test file in which index for this test will live
with
open
(
self
.
TEST_INDEX_FILENAME
,
"w+"
)
as
index_file
:
json
.
dump
({},
index_file
)
self
.
addCleanup
(
remove_file
,
self
.
TEST_INDEX_FILENAME
)
super
(
CoursewareSearchCohortTest
,
self
)
.
setUp
(
is_staff
=
is_staff
)
self
.
staff_user
=
self
.
user
...
...
@@ -79,10 +81,6 @@ class CoursewareSearchCohortTest(ContainerBase):
self
.
_studio_reindex
()
def
tearDown
(
self
):
super
(
CoursewareSearchCohortTest
,
self
)
.
tearDown
()
os
.
remove
(
self
.
TEST_INDEX_FILENAME
)
def
_auto_auth
(
self
,
username
,
email
,
staff
):
"""
Logout and login with given credentials.
...
...
common/test/acceptance/tests/lms/test_lms_split_test_courseware_search.py
View file @
a43cf589
...
...
@@ -4,6 +4,7 @@ Test courseware search
import
os
import
json
from
..helpers
import
remove_file
from
...pages.common.logout
import
LogoutPage
from
...pages.studio.overview
import
CourseOutlinePage
from
...pages.lms.courseware_search
import
CoursewareSearchPage
...
...
@@ -37,6 +38,7 @@ class SplitTestCoursewareSearchTest(ContainerBase):
# create test file in which index for this test will live
with
open
(
self
.
TEST_INDEX_FILENAME
,
"w+"
)
as
index_file
:
json
.
dump
({},
index_file
)
self
.
addCleanup
(
remove_file
,
self
.
TEST_INDEX_FILENAME
)
super
(
SplitTestCoursewareSearchTest
,
self
)
.
setUp
(
is_staff
=
is_staff
)
self
.
staff_user
=
self
.
user
...
...
@@ -53,10 +55,6 @@ class SplitTestCoursewareSearchTest(ContainerBase):
self
.
_add_and_configure_split_test
()
self
.
_studio_reindex
()
def
tearDown
(
self
):
super
(
SplitTestCoursewareSearchTest
,
self
)
.
tearDown
()
os
.
remove
(
self
.
TEST_INDEX_FILENAME
)
def
_auto_auth
(
self
,
username
,
email
,
staff
):
"""
Logout and login with given credentials.
...
...
lms/lib/courseware_search/lms_filter_generator.py
View file @
a43cf589
...
...
@@ -72,7 +72,7 @@ class LmsSearchFilterGenerator(SearchFilterGenerator):
course_key
=
SlashSeparatedCourseKey
.
from_deprecated_string
(
kwargs
[
'course_id'
])
# Staff user looking at course as staff user
if
get_user_role
(
user
,
course_key
)
==
'staff'
:
if
get_user_role
(
user
,
course_key
)
in
(
'instructor'
,
'staff'
)
:
return
filter_dictionary
# Need to check course exist (if course gets deleted enrollments don't get cleaned up)
course
=
modulestore
()
.
get_course
(
course_key
)
...
...
lms/lib/courseware_search/test/test_lms_search_initializer.py
View file @
a43cf589
...
...
@@ -77,7 +77,8 @@ class LmsSearchInitializerTestCase(StaffMasqueradeTestCase):
user
=
self
.
global_staff
,
course_id
=
unicode
(
self
.
course
.
id
)
)
self
.
assertIsNone
(
filter_directory
[
'content_groups'
])
# User is staff by default, no content groups filter is set - see all
self
.
assertNotIn
(
'content_groups'
,
filter_directory
)
# Install a masquerading group
request
=
self
.
_create_mock_json_request
(
...
...
requirements/edx/github.txt
View file @
a43cf589
...
...
@@ -47,7 +47,7 @@ git+https://github.com/edx/ease.git@release-2015-07-14#egg=ease==0.1.3
git+https://github.com/edx/edx-oauth2-provider.git@0.5.5#egg=oauth2-provider==0.5.5
-e git+https://github.com/edx/edx-val.git@v0.0.5#egg=edx-val
-e git+https://github.com/pmitros/RecommenderXBlock.git@518234bc354edbfc2651b9e534ddb54f96080779#egg=recommender-xblock
-e git+https://github.com/edx/edx-search.git@release-2015-07-
14
#egg=edx-search
-e git+https://github.com/edx/edx-search.git@release-2015-07-
22
#egg=edx-search
-e git+https://github.com/edx/edx-milestones.git@release-2015-06-17#egg=edx-milestones
git+https://github.com/edx/edx-lint.git@ed8c8d2a0267d4d42f43642d193e25f8bd575d9b#egg=edx_lint==0.2.3
-e git+https://github.com/edx/xblock-utils.git@213a97a50276d6a2504d8133650b2930ead357a0#egg=xblock-utils
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment