mirror of
https://github.com/jazzband/django-downloadview.git
synced 2026-05-05 06:04:50 +00:00
BaseDownloadViewTestCase: render_to_response mock is now called with args and kwargs
Updated BaseDownloadViewTestCase to not use dummy args/kwargs but kwargs which BaseDownloadView.get() actually forwards to DownloadResponse.__init__().
This commit is contained in:
parent
fb645ce27a
commit
8b8ef8bd28
1 changed files with 3 additions and 3 deletions
|
|
@ -221,14 +221,14 @@ class BaseDownloadViewTestCase(unittest.TestCase):
|
|||
def test_get(self):
|
||||
"""BaseDownloadView.get() calls render_to_response()."""
|
||||
request = django.test.RequestFactory().get('/dummy-url')
|
||||
args = ['dummy-arg']
|
||||
kwargs = {'dummy': 'kwarg'}
|
||||
args = []
|
||||
kwargs = {'content_type': 'application/pdf'}
|
||||
view = setup_view(views.BaseDownloadView(), request, *args, **kwargs)
|
||||
view.render_to_response = mock.Mock(
|
||||
return_value=mock.sentinel.response)
|
||||
response = view.get(request, *args, **kwargs)
|
||||
self.assertIs(response, mock.sentinel.response)
|
||||
view.render_to_response.assert_called_once_with()
|
||||
view.render_to_response.assert_called_once_with(*args, **kwargs)
|
||||
|
||||
|
||||
class PathDownloadViewTestCase(unittest.TestCase):
|
||||
|
|
|
|||
Loading…
Reference in a new issue