def test_id_unsettable(self): model = Model({'id': 'some_uuid'}, 'test') model.id = 'some_uuid' model['id'] = 'some_uuid' self.assertEqual(model.id, 'some_uuid') with self.assertRaises(Exception): model.id = 'another_uuid' with self.assertRaises(Exception): model['id'] = 'another_uuid'