def get_invalid_data_context(self, data, *args):
        serialized_data = self.serialize(data)
        with self.assertRaises(errors.InvalidData) as context:
            self.validator(serialized_data, *args)

        return context
Returns context object of raised InvalidData exception.
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/test/base.py/BaseValidatorTest.get_invalid_data_context