def test_bad_slice(self): with self.assertRaises(ValidationError): validators.day_of_month_validator('*/100') with self.assertRaises(ValidationError): validators.day_of_month_validator('10/30') with self.assertRaises(ValidationError): validators.day_of_month_validator('10-20/100')
def test_out_range(self): with self.assertRaises(ValidationError): validators.day_of_month_validator('0-32') with self.assertRaises(ValidationError): validators.day_of_month_validator('342-432') with self.assertRaises(ValidationError): validators.day_of_month_validator('4-33')
def test_big_number(self): with self.assertRaises(ValidationError): validators.day_of_month_validator('32') with self.assertRaises(ValidationError): validators.day_of_month_validator('420') with self.assertRaises(ValidationError): validators.day_of_month_validator('100500')
def test_text(self): with self.assertRaises(ValidationError): validators.day_of_month_validator('fsd') with self.assertRaises(ValidationError): validators.day_of_month_validator('.') with self.assertRaises(ValidationError): validators.day_of_month_validator('432a')
def test_bad_slice(self): with self.assertRaises(ValidationError): validators.day_of_month_validator('*/100') with self.assertRaises(ValidationError): validators.day_of_month_validator('10/30') with self.assertRaises(ValidationError): validators.day_of_month_validator('10-20/100')
def test_out_range(self): with self.assertRaises(ValidationError): validators.day_of_month_validator('0-32') with self.assertRaises(ValidationError): validators.day_of_month_validator('342-432') with self.assertRaises(ValidationError): validators.day_of_month_validator('4-33')
def test_text(self): with self.assertRaises(ValidationError): validators.day_of_month_validator('fsd') with self.assertRaises(ValidationError): validators.day_of_month_validator('.') with self.assertRaises(ValidationError): validators.day_of_month_validator('432a')
def test_big_number(self): with self.assertRaises(ValidationError): validators.day_of_month_validator('32') with self.assertRaises(ValidationError): validators.day_of_month_validator('420') with self.assertRaises(ValidationError): validators.day_of_month_validator('100500')
def test_bad_range(self): with self.assertRaises(ValidationError): validators.day_of_month_validator('10-4')
def test_zero(self): with self.assertRaises(ValidationError): validators.day_of_month_validator('0')
def test_space(self): with self.assertRaises(ValidationError): validators.day_of_month_validator('1, 2')
def test_good(self): try: validators.day_of_month_validator('*') validators.day_of_month_validator('1') validators.day_of_month_validator('29') validators.day_of_month_validator('31') validators.day_of_month_validator('1,2,31') validators.day_of_month_validator('30,2') validators.day_of_month_validator('5,20,25,31') validators.day_of_month_validator('1-4') validators.day_of_month_validator('1-30') validators.day_of_month_validator('*/4') validators.day_of_month_validator('*/22') validators.day_of_month_validator('1-2/5') except ValidationError as e: self.fail(e)
def test_bad_range(self): with self.assertRaises(ValidationError): validators.day_of_month_validator('10-4')
def test_zero(self): with self.assertRaises(ValidationError): validators.day_of_month_validator('0')
def test_space(self): with self.assertRaises(ValidationError): validators.day_of_month_validator('1, 2')
def test_good(self): try: validators.day_of_month_validator('*') validators.day_of_month_validator('1') validators.day_of_month_validator('29') validators.day_of_month_validator('31') validators.day_of_month_validator('1,2,31') validators.day_of_month_validator('30,2') validators.day_of_month_validator('5,20,25,31') validators.day_of_month_validator('1-4') validators.day_of_month_validator('1-30') validators.day_of_month_validator('*/4') validators.day_of_month_validator('*/22') validators.day_of_month_validator('1-2/5') except ValidationError as e: self.fail(e)