'Edit group configuration and check its id and modified fields.'

def test_can_edit_group_configuration(self):

    self._add_user_partitions()
    self.save_course()
    expected = {u'id': self.ID, u'name': u'New    Test    name', u'scheme': u'random', u'description': u'New    Test    description', u'version': UserPartition.VERSION, u'groups': [{u'id': 0, u'name': u'New    Group    Name', u'version': 1}, {u'id': 2, u'name': u'Group    C', u'version': 1}], u'usage': [], u'parameters': {}, u'active': True}
    response = self.client.put(self._url(), data=json.dumps(expected), content_type='application/json', HTTP_ACCEPT='application/json', HTTP_X_REQUESTED_WITH='XMLHttpRequest')
    content = json.loads(response.content)
    self.assertEqual(content, expected)
    self.reload_course()
    user_partititons = self.course.user_partitions
    self.assertEqual(len(user_partititons), 1)
    self.assertEqual(user_partititons[0].name, u'New    Test    name')
    self.assertEqual(len(user_partititons[0].groups), 2)
    self.assertEqual(user_partititons[0].groups[0].name, u'New    Group    Name')
    self.assertEqual(user_partititons[0].groups[1].name, u'Group    C')
    self.assertEqual(user_partititons[0].parameters, {})
