Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-analytics-data-api-client
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
OpenEdx
edx-analytics-data-api-client
Commits
af5e8437
Commit
af5e8437
authored
Apr 20, 2017
by
Tyler Hallada
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add id_field attribute to fix tests
parent
e584a3b0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
5 deletions
+8
-5
analyticsclient/tests/__init__.py
+6
-5
analyticsclient/tests/test_course_summaries.py
+1
-0
analyticsclient/tests/test_programs.py
+1
-0
No files found.
analyticsclient/tests/__init__.py
View file @
af5e8437
...
@@ -33,6 +33,7 @@ class APIListTestCase(object):
...
@@ -33,6 +33,7 @@ class APIListTestCase(object):
# Override in the subclass:
# Override in the subclass:
endpoint
=
'list'
endpoint
=
'list'
id_field
=
'id'
def
setUp
(
self
):
def
setUp
(
self
):
"""Set up the test case."""
"""Set up the test case."""
...
@@ -74,9 +75,9 @@ class APIListTestCase(object):
...
@@ -74,9 +75,9 @@ class APIListTestCase(object):
[
'edx/demo/course'
],
[
'edx/demo/course'
],
[
'edx/demo/course'
,
'another/demo/course'
]
[
'edx/demo/course'
,
'another/demo/course'
]
)
)
def
test_courses_ids
(
self
,
course_
ids
):
def
test_courses_ids
(
self
,
ids
):
"""Endpoint can be called with
course
IDs."""
"""Endpoint can be called with IDs."""
self
.
kwarg_test
(
course_ids
=
course_ids
)
self
.
kwarg_test
(
**
{
self
.
id_field
:
ids
}
)
@ddt.data
(
@ddt.data
(
[
'course_id'
],
[
'course_id'
],
...
@@ -100,6 +101,6 @@ class APIListTestCase(object):
...
@@ -100,6 +101,6 @@ class APIListTestCase(object):
[
'created'
,
'pacing_type'
])
[
'created'
,
'pacing_type'
])
)
)
@ddt.unpack
@ddt.unpack
def
test_all_parameters
(
self
,
course_
ids
,
fields
,
exclude
):
def
test_all_parameters
(
self
,
ids
,
fields
,
exclude
):
"""Endpoint can be called with all parameters."""
"""Endpoint can be called with all parameters."""
self
.
kwarg_test
(
course_ids
=
course_ids
,
fields
=
fields
,
exclude
=
exclude
)
self
.
kwarg_test
(
**
{
self
.
id_field
:
ids
,
'fields'
:
fields
,
'exclude'
:
exclude
}
)
analyticsclient/tests/test_course_summaries.py
View file @
af5e8437
...
@@ -8,6 +8,7 @@ from analyticsclient.tests import ClientTestCase, APIListTestCase
...
@@ -8,6 +8,7 @@ from analyticsclient.tests import ClientTestCase, APIListTestCase
class
CourseSummariesTests
(
APIListTestCase
,
ClientTestCase
):
class
CourseSummariesTests
(
APIListTestCase
,
ClientTestCase
):
endpoint
=
'course_summaries'
endpoint
=
'course_summaries'
id_field
=
'course_ids'
@ddt.data
(
@ddt.data
(
[
'123'
],
[
'123'
],
...
...
analyticsclient/tests/test_programs.py
View file @
af5e8437
...
@@ -7,3 +7,4 @@ from analyticsclient.tests import ClientTestCase, APIListTestCase
...
@@ -7,3 +7,4 @@ from analyticsclient.tests import ClientTestCase, APIListTestCase
class
ProgramsTests
(
APIListTestCase
,
ClientTestCase
):
class
ProgramsTests
(
APIListTestCase
,
ClientTestCase
):
endpoint
=
'programs'
endpoint
=
'programs'
id_field
=
'program_ids'
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