Commit fef27cb1 by chrisndodge

Merge pull request #21 from edx-solutions/api

fix broken unit test
parents 15a425d7 5c5cba8c
...@@ -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)
......
...@@ -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',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment