'Ensure that URLFields validate urls with specific schemes properly.'

def test_url_scheme_validation(self):

    class Link(Document, ):
        url = URLField()
    class SchemeLink(Document, ):
        url = URLField(schemes=['ws', 'irc'])
    link = Link()
    link.url = 'ws://google.com'
    self.assertRaises(ValidationError, link.validate)
    scheme_link = SchemeLink()
    scheme_link.url = 'ws://google.com'
    scheme_link.validate()
