def test_validate_integer(self): """ Get validate with integer value """ enterprise = Enterprise() enterprise.name = "Test Enterprise" enterprise.floating_ips_quota = 0 is_valid = enterprise.validate() self.assertEqual(is_valid, True) self.assertEqual(len(enterprise.errors), 0)
def test_validate_too_high(self): """ Get validate with integer value too high """ enterprise = Enterprise() enterprise.name = "Test Enterprise" enterprise.floating_ips_quota = 250001 is_valid = enterprise.validate() self.assertEqual(is_valid, False) self.assertEqual(len(enterprise.errors), 1) self.assertIn("floating_ips_quota", enterprise.errors)