def METHOD_NAME(self):
    self.validator = NoWhitespaceValidator()
    value_with_leading_whitespace = ' test_value'
    with self.assertRaises(ValidationError) as cm:
        self.validator(value_with_leading_whitespace)
    self.assertEqual(cm.exception.message, 'Leading and Trailing whitespaces are not allowed.')
    self.assertEqual(cm.exception.code, 'no_whitespace')
    self.assertDictEqual(cm.exception.params, {'value': value_with_leading_whitespace})