def test_disabled_for_the_rest(self, django_gzip_middleware): request = mock.Mock() request.API = False GZipMiddleware().process_response(request, mock.Mock()) ok_(not django_gzip_middleware.called)
def test_enabled_for_api(self, django_gzip_middleware): request = mock.Mock() request.API = True GZipMiddleware().process_response(request, mock.Mock()) ok_(django_gzip_middleware.called)