Did I find the right examples for you? yes no

All Samples(18)  |  Call(14)  |  Derive(0)  |  Import(4)

src/d/j/django-downloadview-1.6/django_downloadview/api.py   django-downloadview(Download)
                                       DownloadMixin)
from django_downloadview.shortcuts import sendfile  # NoQA
from django_downloadview.test import (assert_download_response,  # NoQA
                                      setup_view,
                                      temporary_media_root)

src/d/j/django-downloadview-HEAD/django_downloadview/api.py   django-downloadview(Download)
                                       DownloadMixin)
from django_downloadview.shortcuts import sendfile  # NoQA
from django_downloadview.test import (assert_download_response,  # NoQA
                                      setup_view,
                                      temporary_media_root)

src/d/j/django-downloadview-1.6/django_downloadview/tests/views.py   django-downloadview(Download)
 
from django_downloadview import exceptions
from django_downloadview.test import setup_view
from django_downloadview.response import DownloadResponse
from django_downloadview import views
        args = ['dummy-arg']
        kwargs = {'dummy': 'kwarg'}
        view = setup_view(views.BaseDownloadView(), request, *args, **kwargs)
        view.render_to_response = mock.Mock(
            return_value=mock.sentinel.response)
    def test_get_file_ok(self):
        "PathDownloadView.get_file() returns ``File`` instance."
        view = setup_view(views.PathDownloadView(path=__file__),
                          'fake request')
        file_wrapper = view.get_file()
 
        """
        view = setup_view(views.PathDownloadView(path='i-do-no-exist'),
                          'fake request')
        with self.assertRaises(exceptions.FileNotFound):
    def test_get_file_is_directory(self):
        """PathDownloadView.get_file() raises FileNotFound if file is a
        directory."""
        view = setup_view(
            views.PathDownloadView(path=os.path.dirname(__file__)),

src/d/j/django-downloadview-HEAD/django_downloadview/tests/views.py   django-downloadview(Download)
 
from django_downloadview import exceptions
from django_downloadview.test import setup_view
from django_downloadview.response import DownloadResponse
from django_downloadview import views
        args = ['dummy-arg']
        kwargs = {'dummy': 'kwarg'}
        view = setup_view(views.BaseDownloadView(), request, *args, **kwargs)
        view.render_to_response = mock.Mock(
            return_value=mock.sentinel.response)
    def test_get_file_ok(self):
        "PathDownloadView.get_file() returns ``File`` instance."
        view = setup_view(views.PathDownloadView(path=__file__),
                          'fake request')
        file_wrapper = view.get_file()
 
        """
        view = setup_view(views.PathDownloadView(path='i-do-no-exist'),
                          'fake request')
        with self.assertRaises(exceptions.FileNotFound):
    def test_get_file_is_directory(self):
        """PathDownloadView.get_file() raises FileNotFound if file is a
        directory."""
        view = setup_view(
            views.PathDownloadView(path=os.path.dirname(__file__)),