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
fef27cb1
Commit
fef27cb1
authored
Apr 23, 2014
by
chrisndodge
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #21 from edx-solutions/api
fix broken unit test
parents
15a425d7
5c5cba8c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
6 deletions
+2
-6
lms/djangoapps/api_manager/groups_views.py
+1
-1
lms/djangoapps/api_manager/tests/test_groups_views.py
+1
-5
No files found.
lms/djangoapps/api_manager/groups_views.py
View file @
fef27cb1
...
@@ -131,7 +131,7 @@ def group_detail(request, group_id):
...
@@ -131,7 +131,7 @@ def group_detail(request, group_id):
# update GroupProfile data
# update GroupProfile data
group_type
=
request
.
DATA
.
get
(
'group_type'
)
group_type
=
request
.
DATA
.
get
(
'group_type'
)
data
=
request
.
DATA
.
get
(
'data'
)
data
=
json
.
dumps
(
request
.
DATA
.
get
(
'data'
))
if
request
.
DATA
.
get
(
'data'
)
else
None
if
not
group_type
and
not
data
:
if
not
group_type
and
not
data
:
return
Response
({},
status
.
HTTP_400_BAD_REQUEST
)
return
Response
({},
status
.
HTTP_400_BAD_REQUEST
)
...
...
lms/djangoapps/api_manager/tests/test_groups_views.py
View file @
fef27cb1
...
@@ -53,7 +53,7 @@ class GroupsApiTests(TestCase):
...
@@ -53,7 +53,7 @@ class GroupsApiTests(TestCase):
'Content-Type'
:
'application/json'
,
'Content-Type'
:
'application/json'
,
'X-Edx-Api-Key'
:
str
(
TEST_API_KEY
),
'X-Edx-Api-Key'
:
str
(
TEST_API_KEY
),
}
}
response
=
self
.
client
.
post
(
uri
,
headers
=
headers
,
data
=
data
)
response
=
self
.
client
.
post
(
uri
,
headers
=
headers
,
data
=
json
.
dumps
(
data
),
content_type
=
'application/json'
)
return
response
return
response
def
do_get
(
self
,
uri
):
def
do_get
(
self
,
uri
):
...
@@ -108,10 +108,6 @@ class GroupsApiTests(TestCase):
...
@@ -108,10 +108,6 @@ class GroupsApiTests(TestCase):
self
.
assertEqual
(
response
.
data
[
'name'
],
self
.
test_group_name
)
self
.
assertEqual
(
response
.
data
[
'name'
],
self
.
test_group_name
)
def
test_group_list_get_with_profile
(
self
):
def
test_group_list_get_with_profile
(
self
):
# skip test. Seems like the Django test client is not serializing the nested JSON
# post arguments. Need to investigate
return
data
=
{
data
=
{
'name'
:
self
.
test_group_name
,
'name'
:
self
.
test_group_name
,
'group_type'
:
'series'
,
'group_type'
:
'series'
,
...
...
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