'Test that you can create a group configuration.'

def test_can_create_group_configuration(self):

    expected = {u'description': u'Test    description', u'name': u'Test    name', u'scheme': u'random', u'version': UserPartition.VERSION, u'groups': [{u'name': u'Group    A', u'version': 1}, {u'name': u'Group    B', u'version': 1}], u'parameters': {}, u'active': True}
    response = self.client.ajax_post(self._url(), data=GROUP_CONFIGURATION_JSON)
    self.assertEqual(response.status_code, 201)
    self.assertIn('Location', response)
    content = json.loads(response.content)
    (configuration_id, group_ids) = self._remove_ids(content)
    self.assertEqual(content, expected)
    self.assertEqual(len(group_ids), len(set(group_ids)))
    self.assertEqual(len(group_ids), 2)
    self.reload_course()
    user_partititons = self.course.user_partitions
    self.assertEqual(len(user_partititons), 1)
    self.assertEqual(user_partititons[0].name, u'Test    name')
    self.assertEqual(len(user_partititons[0].groups), 2)
    self.assertEqual(user_partititons[0].groups[0].name, u'Group    A')
    self.assertEqual(user_partititons[0].groups[1].name, u'Group    B')
    self.assertEqual(user_partititons[0].parameters, {})
