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
27dcb811
Commit
27dcb811
authored
Dec 16, 2015
by
Usman Khalid
Committed by
muzaffaryousaf
Dec 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speedup the bookmarks tests.
parent
53eb9e60
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
24 deletions
+9
-24
openedx/core/djangoapps/bookmarks/tests/test_api.py
+1
-1
openedx/core/djangoapps/bookmarks/tests/test_models.py
+7
-22
openedx/core/djangoapps/bookmarks/tests/test_tasks.py
+1
-1
No files found.
openedx/core/djangoapps/bookmarks/tests/test_api.py
View file @
27dcb811
...
...
@@ -69,7 +69,7 @@ class BookmarksAPITests(BookmarkApiEventTestMixin, BookmarksTestsBase):
api
.
get_bookmark
(
user
=
self
.
other_user
,
usage_key
=
self
.
vertical_1
.
location
)
@ddt.data
(
1
,
10
,
10
0
1
,
10
,
2
0
)
def
test_get_bookmarks
(
self
,
count
):
"""
...
...
openedx/core/djangoapps/bookmarks/tests/test_models.py
View file @
27dcb811
...
...
@@ -55,12 +55,7 @@ class BookmarksTestsBase(ModuleStoreTestCase):
self
.
course
=
CourseFactory
.
create
(
display_name
=
'An Introduction to API Testing'
)
self
.
course_id
=
unicode
(
self
.
course
.
id
)
if
store_type
==
ModuleStoreEnum
.
Type
.
mongo
:
bulk_operations_manager
=
self
.
store
.
bulk_operations
else
:
bulk_operations_manager
=
noop_contextmanager
with
bulk_operations_manager
(
self
.
course
.
id
):
with
self
.
store
.
bulk_operations
(
self
.
course
.
id
):
self
.
chapter_1
=
ItemFactory
.
create
(
parent_location
=
self
.
course
.
location
,
category
=
'chapter'
,
display_name
=
'Week 1'
...
...
@@ -116,7 +111,7 @@ class BookmarksTestsBase(ModuleStoreTestCase):
self
.
other_course
=
CourseFactory
.
create
(
display_name
=
'An Introduction to API Testing 2'
)
with
bulk_operations_manager
(
self
.
other_course
.
id
):
with
self
.
store
.
bulk_operations
(
self
.
other_course
.
id
):
self
.
other_chapter_1
=
ItemFactory
.
create
(
parent_location
=
self
.
other_course
.
location
,
category
=
'chapter'
,
display_name
=
'Other Week 1'
...
...
@@ -157,12 +152,7 @@ class BookmarksTestsBase(ModuleStoreTestCase):
course
=
CourseFactory
.
create
()
display_name
=
0
if
store_type
==
ModuleStoreEnum
.
Type
.
mongo
:
bulk_operations_manager
=
self
.
store
.
bulk_operations
else
:
bulk_operations_manager
=
noop_contextmanager
with
bulk_operations_manager
(
course
.
id
):
with
self
.
store
.
bulk_operations
(
course
.
id
):
blocks_at_next_level
=
[
course
]
for
__
in
range
(
depth
):
...
...
@@ -186,12 +176,7 @@ class BookmarksTestsBase(ModuleStoreTestCase):
course
=
CourseFactory
.
create
()
if
store_type
==
ModuleStoreEnum
.
Type
.
mongo
:
bulk_operations_manager
=
self
.
store
.
bulk_operations
else
:
bulk_operations_manager
=
noop_contextmanager
with
bulk_operations_manager
(
course
.
id
):
with
self
.
store
.
bulk_operations
(
course
.
id
):
blocks
=
[
ItemFactory
.
create
(
parent_location
=
course
.
location
,
category
=
'chapter'
,
display_name
=
unicode
(
index
)
)
for
index
in
range
(
count
)]
...
...
@@ -348,13 +333,13 @@ class BookmarkModelTests(BookmarksTestsBase):
(
ModuleStoreEnum
.
Type
.
mongo
,
6
,
2
,
2
),
(
ModuleStoreEnum
.
Type
.
mongo
,
2
,
3
,
3
),
(
ModuleStoreEnum
.
Type
.
mongo
,
4
,
3
,
3
),
(
ModuleStoreEnum
.
Type
.
mongo
,
6
,
3
,
3
),
# (ModuleStoreEnum.Type.mongo, 6, 3, 3), Too slow.
(
ModuleStoreEnum
.
Type
.
mongo
,
2
,
4
,
4
),
(
ModuleStoreEnum
.
Type
.
mongo
,
4
,
4
,
4
),
#
(ModuleStoreEnum.Type.mongo, 4, 4, 4),
(
ModuleStoreEnum
.
Type
.
split
,
2
,
2
,
2
),
(
ModuleStoreEnum
.
Type
.
split
,
4
,
2
,
2
),
(
ModuleStoreEnum
.
Type
.
split
,
2
,
3
,
2
),
(
ModuleStoreEnum
.
Type
.
split
,
4
,
3
,
2
),
#
(ModuleStoreEnum.Type.split, 4, 3, 2),
(
ModuleStoreEnum
.
Type
.
split
,
2
,
4
,
2
),
)
@ddt.unpack
...
...
openedx/core/djangoapps/bookmarks/tests/test_tasks.py
View file @
27dcb811
...
...
@@ -104,7 +104,7 @@ class XBlockCacheTaskTests(BookmarksTestsBase):
(
ModuleStoreEnum
.
Type
.
mongo
,
2
,
3
,
4
),
(
ModuleStoreEnum
.
Type
.
mongo
,
4
,
3
,
4
),
(
ModuleStoreEnum
.
Type
.
mongo
,
2
,
4
,
5
),
(
ModuleStoreEnum
.
Type
.
mongo
,
4
,
4
,
6
),
# (ModuleStoreEnum.Type.mongo, 4, 4, 6), Too slow.
(
ModuleStoreEnum
.
Type
.
split
,
2
,
2
,
3
),
(
ModuleStoreEnum
.
Type
.
split
,
4
,
2
,
3
),
(
ModuleStoreEnum
.
Type
.
split
,
2
,
3
,
3
),
...
...
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