def test_cname_validation_fail(self): record = Record() record.type = 'C' record.domain_id = 1 record.host = 'foobar.com' record.val = 'www.example.com ' with self.assertRaises(RecordValueException) as cm: record.validate() self.assertEquals('Invalid cname value: www.example.com ', cm.exception.message)
def test_cname_validation_fail(self): record = Record() record.type = 'C' record.domain_id = 1 record.host = 'foobar.com' record.val = 'www.example.com ' with self.assertRaises(RecordValueException) as cm: record.validate() self.assertEquals( 'Invalid cname value: www.example.com ', cm.exception.message )
def test_cname_validation_success(self): record = Record() record.type = 'C' record.domain_id = 1 record.host = 'foobar.com' record.val = 'www.example.com' self.assertIsNone(record.validate())