'Test preprocessing of a create-node request'

def testPreprocessCreateNode(self):

    r = s3_request('test', 'hierarchy', http='POST')
    parent_node = self.rows['HIERARCHY1']
    parent_id = parent_node.id
    h = S3Hierarchy('test_hierarchy')
    link = h.preprocess_create_node(r, parent_id)
    self.assertEqual(link, None)
    assertEqual = self.assertEqual
    post_vars = r.post_vars
    assertEqual(post_vars['parent'], parent_id)
    field = r.table.parent
    assertEqual(field.default, parent_id)
    assertEqual(field.update, parent_id)
    self.assertFalse(field.readable)
    self.assertFalse(field.writable)
