Commits

Ollie Rutherfurd committed 70e2e0f

HTTPURLValidator no longer treats values that don't start with http as valid

Comments (0)

Files changed (2)

flatland/validation/network.py

 
     def validate(self, element, state):
         url = element.value
-        if url is None or not url.startswith('http'):
+        if url is None:
             return True
         parsed = self.urlparse.urlparse(url)
 

tests/validation/test_network.py

     not v.validate(el, None)
     eq_(el.errors, ['X'])
 
+    el = scalar('www.example.com')
+    not v.validate(el, None)
+    eq_(el.errors, ['test is not a valid URL.'])
+
 
 def test_url_canonicalizer_default():
     v = URLCanonicalizer()