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
52928d16
Commit
52928d16
authored
Jul 29, 2013
by
Chris Dodge
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update SplitModuleStore tests to pull the course_id from the locator
parent
e4eea6cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py
+7
-6
No files found.
common/lib/xmodule/xmodule/modulestore/tests/test_split_modulestore.py
View file @
52928d16
...
...
@@ -265,11 +265,11 @@ class SplitModuleItemTests(SplitModuleTest):
locator
=
BlockUsageLocator
(
course_id
=
'GreekHero'
,
usage_id
=
'head12345'
,
branch
=
'draft'
)
self
.
assertTrue
(
modulestore
()
.
has_item
(
course_id
,
locator
),
modulestore
()
.
has_item
(
locator
.
course_id
,
locator
),
"couldn't find in 12345"
)
self
.
assertTrue
(
modulestore
()
.
has_item
(
course_id
,
BlockUsageLocator
(
modulestore
()
.
has_item
(
locator
.
course_id
,
BlockUsageLocator
(
course_id
=
locator
.
course_id
,
branch
=
'draft'
,
usage_id
=
locator
.
usage_id
...
...
@@ -277,7 +277,7 @@ class SplitModuleItemTests(SplitModuleTest):
"couldn't find in draft 12345"
)
self
.
assertFalse
(
modulestore
()
.
has_item
(
course_id
,
BlockUsageLocator
(
modulestore
()
.
has_item
(
locator
.
course_id
,
BlockUsageLocator
(
course_id
=
locator
.
course_id
,
branch
=
'published'
,
usage_id
=
locator
.
usage_id
)),
...
...
@@ -285,26 +285,27 @@ class SplitModuleItemTests(SplitModuleTest):
)
locator
.
branch
=
'draft'
self
.
assertTrue
(
modulestore
()
.
has_item
(
course_id
,
locator
),
modulestore
()
.
has_item
(
locator
.
course_id
,
locator
),
"not found in draft 12345"
)
# not a course obj
locator
=
BlockUsageLocator
(
course_id
=
'GreekHero'
,
usage_id
=
'chapter1'
,
branch
=
'draft'
)
self
.
assertTrue
(
modulestore
()
.
has_item
(
course_id
,
locator
),
modulestore
()
.
has_item
(
locator
.
course_id
,
locator
),
"couldn't find chapter1"
)
# in published course
locator
=
BlockUsageLocator
(
course_id
=
"wonderful"
,
usage_id
=
"head23456"
,
revision
=
'draft'
)
self
.
assertTrue
(
modulestore
()
.
has_item
(
course_id
,
BlockUsageLocator
(
course_id
=
locator
.
course_id
,
self
.
assertTrue
(
modulestore
()
.
has_item
(
locator
.
course_id
,
BlockUsageLocator
(
course_id
=
locator
.
course_id
,
usage_id
=
locator
.
usage_id
,
revision
=
'published'
)),
"couldn't find in 23456"
)
locator
.
branch
=
'published'
self
.
assertTrue
(
modulestore
()
.
has_item
(
course_id
,
locator
),
"couldn't find in 23456"
)
def
test_negative_has_item
(
self
):
# negative tests--not found
# no such course or block
...
...
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