def test_enum_does_not_allow_invalid_value(self):
    allowed = True
    try:
        self.enum_obj.container.e = 'twentyseven'
    except ValueError:
        allowed = False
    self.assertFalse(allowed, ('Erroneous value was not caught by restriction handler (%s)' % self.enum_obj.container.e))
def test_enum_does_not_allow_invalid_value(self):
    allowed = True
    try:
        self.enum_obj.container.e = 'twentyseven'
    except ValueError:
        allowed = False
    self.assertFalse(allowed, ('Erroneous value was not caught by restriction handler (%s)' % self.enum_obj.container.e))