def test_render_to_response_not_modified(self):
        # Setup.
        mixin = views.DownloadMixin()
        mixin.request = django.test.RequestFactory().get(
            '/dummy-url',
            HTTP_IF_MODIFIED_SINCE=mock.sentinel.http_if_modified_since)
        mixin.was_modified_since = mock.Mock(return_value=False)
        mixin.not_modified_response = mock.Mock(
            return_value=mock.sentinel.http_not_modified_response)
        mixin.get_file = mock.Mock(return_value=mock.sentinel.file_wrapper)
        # Run.
        response = mixin.render_to_response()
        # Check.
        self.assertIs(response, mock.sentinel.http_not_modified_response)
        mixin.get_file.assert_called_once_with()
        mixin.was_modified_since.assert_called_once_with(
            mock.sentinel.file_wrapper,
            mock.sentinel.http_if_modified_since)
        mixin.not_modified_response.assert_called_once_with()
DownloadMixin.render_to_response() respects HTTP_IF_MODIFIED_SINCE
dataset/ETHPy150Open benoitbryon/django-downloadview/tests/views.py/DownloadMixinTestCase.test_render_to_response_not_modified