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
704ae713
Commit
704ae713
authored
Jul 27, 2015
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a subclass-implementation of the UserStateClient tests
parent
6530d5e3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
3 deletions
+70
-3
lms/djangoapps/courseware/model_data.py
+2
-2
lms/djangoapps/courseware/tests/test_user_state_client.py
+67
-0
requirements/edx/github.txt
+1
-1
No files found.
lms/djangoapps/courseware/model_data.py
View file @
704ae713
...
...
@@ -392,11 +392,11 @@ class UserStateCache(object):
Returns: datetime if there was a modified date, or None otherwise
"""
return
self
.
_client
.
get
_mod_date
(
return
self
.
_client
.
get
(
self
.
user
.
username
,
kvs_key
.
block_scope_id
,
fields
=
[
kvs_key
.
field_name
],
)
.
get
(
kvs_key
.
field_name
)
)
.
updated
@contract
(
kv_dict
=
"dict(DjangoKeyValueStore_Key: *)"
)
def
set_many
(
self
,
kv_dict
):
...
...
lms/djangoapps/courseware/tests/test_user_state_client.py
0 → 100644
View file @
704ae713
"""
Black-box tests of the DjangoUserStateClient against the semantics
defined in edx_user_state_client.
"""
from
collections
import
defaultdict
from
unittest
import
skip
from
django.test
import
TestCase
from
edx_user_state_client.tests
import
UserStateClientTestBase
from
courseware.user_state_client
import
DjangoXBlockUserStateClient
from
courseware.tests.factories
import
UserFactory
class
TestDjangoUserStateClient
(
UserStateClientTestBase
,
TestCase
):
"""
Tests of the DjangoUserStateClient backend.
"""
__test__
=
True
def
_user
(
self
,
user_idx
):
return
self
.
users
[
user_idx
]
.
username
def
_block_type
(
self
,
block
):
# pylint: disable=unused-argument
# We only record block state history in DjangoUserStateClient
# when the block type is 'problem'
return
'problem'
def
setUp
(
self
):
super
(
TestDjangoUserStateClient
,
self
)
.
setUp
()
self
.
client
=
DjangoXBlockUserStateClient
()
self
.
users
=
defaultdict
(
UserFactory
.
create
)
# We're skipping these tests because the iter_all_by_block and iter_all_by_course
# are not implemented in the DjangoXBlockUserStateClient
@skip
(
"Not supported by DjangoXBlockUserStateClient"
)
def
test_iter_blocks_deleted_block
(
self
):
pass
@skip
(
"Not supported by DjangoXBlockUserStateClient"
)
def
test_iter_blocks_empty
(
self
):
pass
@skip
(
"Not supported by DjangoXBlockUserStateClient"
)
def
test_iter_blocks_many_users
(
self
):
pass
@skip
(
"Not supported by DjangoXBlockUserStateClient"
)
def
test_iter_blocks_single_user
(
self
):
pass
@skip
(
"Not supported by DjangoXBlockUserStateClient"
)
def
test_iter_course_deleted_block
(
self
):
pass
@skip
(
"Not supported by DjangoXBlockUserStateClient"
)
def
test_iter_course_empty
(
self
):
pass
@skip
(
"Not supported by DjangoXBlockUserStateClient"
)
def
test_iter_course_single_user
(
self
):
pass
@skip
(
"Not supported by DjangoXBlockUserStateClient"
)
def
test_iter_course_many_users
(
self
):
pass
requirements/edx/github.txt
View file @
704ae713
...
...
@@ -55,7 +55,7 @@ git+https://github.com/edx/edx-lint.git@ed8c8d2a0267d4d42f43642d193e25f8bd575d9b
-e git+https://github.com/edx-solutions/xblock-google-drive.git@138e6fa0bf3a2013e904a085b9fed77dab7f3f21#egg=xblock-google-drive
-e git+https://github.com/edx/edx-reverification-block.git@485c189f4c5d9ad34e8856e385be546c0ad0a9aa#egg=edx-reverification-block
git+https://github.com/edx/ecommerce-api-client.git@1.1.0#egg=ecommerce-api-client==1.1.0
-e git+https://github.com/edx/edx-user-state-client.git@
64a8b603f42669bb7fdca03d364d4e8d3d6ad67d
#egg=edx-user-state-client
-e git+https://github.com/edx/edx-user-state-client.git@
30c0ad4b9f57f8d48d6943eb585ec8a9205f4469
#egg=edx-user-state-client
-e git+https://github.com/edx/edx-proctoring.git@release-2015-07-29#egg=edx-proctoring
# Third Party XBlocks
...
...
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