#NEWLINE# def test_was_modified_since_django( self ) : #NEWLINE# #INDENT# "DownloadMixin.was_modified_since() tries (2) files attributes.\n\n        When calling file wrapper's ``was_modified_since()`` raises\n        ``NotImplementedError`` or ``AttributeError``,\n        :meth:`django_downloadview.views.base.DownloadMixin.was_modified_since`\n        tries to pass file wrapper's ``size`` and ``modified_time`` to\n        :func:`django.views.static import was_modified_since`.\n\n        " #NEWLINE# file_wrapper = mock . Mock ( ) #NEWLINE# file_wrapper . was_modified_since = mock . Mock ( side_effect = AttributeError ) #NEWLINE# file_wrapper . size = mock . sentinel . size #NEWLINE# file_wrapper . modified_time = datetime . now ( ) #NEWLINE# was_modified_since_mock = mock . Mock ( return_value = mock . sentinel . was_modified ) #NEWLINE# mixin = views . DownloadMixin ( ) #NEWLINE# with mock . patch ( 'django_downloadview.views.base.was_modified_since' , new = was_modified_since_mock ) : #NEWLINE# #INDENT# self . assertIs ( mixin . was_modified_since ( file_wrapper , mock . sentinel . since ) , mock . sentinel . was_modified ) #NEWLINE# #UNINDENT# was_modified_since_mock . assert_called_once_with ( mock . sentinel . since , calendar . timegm ( file_wrapper . modified_time . utctimetuple ( ) ) , mock . sentinel . size )