Commit 5c5cba8c by Chris Dodge

fix broken unit test

parent 95d0ee36
......@@ -131,7 +131,7 @@ def group_detail(request, group_id):
# update GroupProfile data
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:
return Response({}, status.HTTP_400_BAD_REQUEST)
......
......@@ -53,7 +53,7 @@ class GroupsApiTests(TestCase):
'Content-Type': 'application/json',
'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
def do_get(self, uri):
......@@ -108,10 +108,6 @@ class GroupsApiTests(TestCase):
self.assertEqual(response.data['name'], self.test_group_name)
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 = {
'name': self.test_group_name,
'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