Ejemplo n.º 1
0
 def test_validate_remote_id(self):
     ''' should look like a url '''
     self.assertIsNone(fields.validate_remote_id('http://www.example.com'))
     self.assertIsNone(fields.validate_remote_id('https://www.example.com'))
     self.assertIsNone(
         fields.validate_remote_id('http://exle.com/dlg-23/x'))
     self.assertRaises(ValidationError, fields.validate_remote_id,
                       'http:/example.com/dlfjg-23/x')
     self.assertRaises(ValidationError, fields.validate_remote_id,
                       'www.example.com/dlfjg-23/x')
     self.assertRaises(ValidationError, fields.validate_remote_id,
                       'http://www.example.com/dlfjg 23/x')
Ejemplo n.º 2
0
 def test_validate_remote_id(self):
     """should look like a url"""
     self.assertIsNone(fields.validate_remote_id("http://www.example.com"))
     self.assertIsNone(fields.validate_remote_id("https://www.example.com"))
     self.assertIsNone(
         fields.validate_remote_id("http://exle.com/dlg-23/x"))
     self.assertRaises(ValidationError, fields.validate_remote_id,
                       "http:/example.com/dlfjg-23/x")
     self.assertRaises(ValidationError, fields.validate_remote_id,
                       "www.example.com/dlfjg-23/x")
     self.assertRaises(
         ValidationError,
         fields.validate_remote_id,
         "http://www.example.com/dlfjg 23/x",
     )