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')
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", )