Did I find the right examples for you? yes no

All Samples(10)  |  Call(6)  |  Derive(0)  |  Import(4)

src/d/j/django-downloadview-1.6/django_downloadview/tests/views.py   django-downloadview(Download)
from django_downloadview.response import DownloadResponse
from django_downloadview import views
from django_downloadview.shortcuts import sendfile
 
 
    def test_defaults(self):
        """sendfile() takes at least request and filename."""
        request = django.test.RequestFactory().get('/fake-url')
        filename = __file__
        response = sendfile(request, filename)
    def test_custom(self):
        """sendfile() accepts various arguments for response tuning."""
        request = django.test.RequestFactory().get('/fake-url')
        filename = __file__
        response = sendfile(request,
        filename = 'i-do-no-exist'
        with self.assertRaises(Http404):
            sendfile(request, filename)
 

src/d/j/django-downloadview-HEAD/django_downloadview/tests/views.py   django-downloadview(Download)
from django_downloadview.response import DownloadResponse
from django_downloadview import views
from django_downloadview.shortcuts import sendfile
 
 
    def test_defaults(self):
        """sendfile() takes at least request and filename."""
        request = django.test.RequestFactory().get('/fake-url')
        filename = __file__
        response = sendfile(request, filename)
    def test_custom(self):
        """sendfile() accepts various arguments for response tuning."""
        request = django.test.RequestFactory().get('/fake-url')
        filename = __file__
        response = sendfile(request,
        filename = 'i-do-no-exist'
        with self.assertRaises(Http404):
            sendfile(request, filename)
 

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

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