def test_enabled(self): """Testing function enabled.""" # Test existing attribute user_ = _insert_random_user() modify = user.Modify(user_.username) # Test modification new = bool(randint(0, 1)) modify.enabled(new) result = user.User(user_.username) self.assertEqual(result.enabled, new)
def test_role(self): """Testing function role.""" # Test existing attribute user_ = _insert_random_user() modify = user.Modify(user_.username) # Test modification new = randint(0, 99) modify.role(new) result = user.User(user_.username) self.assertEqual(result.role, new)
def test_last_name(self): """Testing function last_name.""" # Test existing attribute user_ = _insert_random_user() modify = user.Modify(user_.username) # Test modification new = data.hashstring(str(random())) modify.last_name(new) result = user.User(user_.username) self.assertEqual(result.last_name, new)
def test_password(self): """Testing function password.""" # Test existing attribute user_ = _insert_random_user() modify = user.Modify(user_.username) # Test modification new = data.hashstring(str(random())) modify.password(new) result = user.User(user_.username) self.assertTrue(result.valid_password(new))
def test___init__(self): """Testing function __init__.""" # Try bad username with self.assertRaises(SystemExit): user.Modify(data.hashstring(str(random())))