示例#1
0
 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)
示例#2
0
 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 = ''