def getall(self):
        try:
            spec = {'data': {'$exists': 1}}
            fields = {'_id': 0}
            sort = [('tid', 1)]
            cur = self.db.docs.find(spec, fields, sort=sort)
        except Exception as e:
            raise DatabaseException(e)
        return [Document(**row) for row in cur]
def check_url_error_message(value):
    try:
        inputs.url(value)
        assert False, u"inputs.url({0}) should raise an exception".format(value)
    except ValueError as e:
        assert_equal(six.text_type(e),
                     (u"{0} is not a valid URL. Did you mean: http://{0}".format(value)))