def test_setattr_no_validate(self): a = PortalMember(validate=False) a.nonexistent_atrribute = 9 rand_name = _random_string() a.name = rand_name self.assertEqual(a.nonexistent_atrribute, 9) self.assertEqual(dict(a)['name'], rand_name)
def test_manual_validate_fail(self): member = PortalMember( validate=False, name='rick', displayName='Somersault jump', allowCallDirect='Get Schwifty!', # must be bool password='******', extension=123, emailAddress='test@localhost' ) with self.assertRaises(ValueError): member.validate()
def test_manual_validate_success(self): member = PortalMember( validate=False, name='rick', displayName='Somersault jump', password='******', extension=123, emailAddress='test@localhost' ) with self.assertRaises(ValueError): member.validate()
def test_setattr_validate(self): a = PortalMember() a.nonexistent_atrribute = 9 rand_name = _random_string() a.name = rand_name self.assertEqual(a.nonexistent_atrribute, 9) self.assertEqual(dict(a)['name'], rand_name) with self.assertRaises(ValueError): a.password = ''