Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(6)  |  Derive(0)  |  Import(2)

src/m/e/mediadrop-HEAD/mediadrop/lib/helpers.py   mediadrop(Download)
from mediadrop.lib.uri import (best_link_uri, download_uri, file_path,
    pick_uri, pick_uris, web_uri)
from mediadrop.lib.util import (current_url, delete_files, merge_dicts, 
    redirect, url, url_for, url_for_media)
from mediadrop.lib.xhtml import (clean_xhtml, decode_entities, encode_entities,

src/m/e/mediadrop-HEAD/mediadrop/lib/tests/current_url_test.py   mediadrop(Download)
from mediadrop.lib.test.request_mixin import RequestMixin
from mediadrop.lib.test.support import create_wsgi_environ
from mediadrop.lib.util import current_url
 
 
class CurrentURLTest(DBTestCase, RequestMixin):
    def test_can_return_url(self):
        request = self.init_fake_request(server_name='server.example', request_uri='/media/view')
        self._inject_url_generator_for_request(request)
        assert_equals('/media/view', current_url(qualified=False))
    def test_can_return_url(self):
        request = self.init_fake_request(server_name='server.example', request_uri='/media/view')
        self._inject_url_generator_for_request(request)
        assert_equals('/media/view', current_url(qualified=False))
        assert_equals('http://server.example:80/media/view', current_url(qualified=True))
    def test_can_return_url_with_query_string(self):
        request = self.init_fake_request(server_name='server.example', 
            request_uri='/media/view?id=123')
        self._inject_url_generator_for_request(request)
        assert_equals('/media/view?id=123', current_url(qualified=False))
        error_request.environ['pylons.original_request'] = user_request
 
        assert_equals(user_url, current_url())
 
    def test_wsgi_deployment_in_a_subdirectory(self):