Include a CNAMe test for url with path too

This commit is contained in:
Ross McFarland
2022-02-04 15:50:25 -08:00
parent 5fdb63ea07
commit 99da4abd9f
+10
View File
@@ -2291,6 +2291,16 @@ class TestRecordValidation(TestCase):
self.assertEqual(['CNAME value "https://google.com" is not a valid '
'FQDN'], ctx.exception.reasons)
# doesn't allow urls with paths
with self.assertRaises(ValidationError) as ctx:
Record.new(self.zone, 'www', {
'type': 'CNAME',
'ttl': 600,
'value': 'https://google.com/a/b/c',
})
self.assertEqual(['CNAME value "https://google.com/a/b/c" is not a '
'valid FQDN'], ctx.exception.reasons)
# doesn't allow paths
with self.assertRaises(ValidationError) as ctx:
Record.new(self.zone, 'www', {