'Test successful main table validation'

def testValidateMainTable(self):

    request = self.request
    crud = self.resource.crud
    jsonstr = '{"name":"TestOrganisation",    "acronym":"TO"}'
    request.body = StringIO(jsonstr)
    output = crud.validate(request)
    self.assertTrue(isinstance(output, basestring))
    data = json.loads(output)
    self.assertTrue(isinstance(data, dict))
    self.assertEqual(len(data), 2)
    self.assertTrue(('name' in data))
    name = data['name']
    self.assertTrue(isinstance(name, dict))
    self.assertTrue(('value' in name))
    self.assertTrue(('text' in name))
    self.assertTrue(isinstance(name['text'], basestring))
    self.assertFalse(('_error' in name))
    acronym = data['acronym']
    self.assertTrue(isinstance(acronym, dict))
    self.assertTrue(('value' in acronym))
    self.assertTrue(('text' in acronym))
    self.assertTrue(isinstance(acronym['text'], basestring))
    self.assertFalse(('_error' in acronym))
