@@ -0,0 +1,1700 @@
+from django.http.response import HttpResponse%0Afrom django.test import TestCase%0Afrom mock import MagicMock%0A%0Afrom rewrite_external_links.middleware import RewriteExternalLinksMiddleware%0A%0A%0Aclass TestRewriteExternalLinksMiddleware(TestCase):%0A    def setUp(self):%0A        self.middleware = RewriteExternalLinksMiddleware()%0A%0A    def test_no_response_content(self):%0A        %22%22%22response doesn't change if no response content.%22%22%22%0A        request = MagicMock()%0A        content_type = 'application/thraud+xml'%0A        initial_response = HttpResponse(content_type=content_type)%0A        processed_response = self.middleware.process_response(%0A            request=request,%0A            response=initial_response,%0A        )%0A        self.assertEqual(processed_response, initial_response)%0A%0A    def test_other_content_type(self):%0A        %22%22%22response doesn't change if %60Content-Type%60 is not %60text/html%60.%22%22%22%0A        request = MagicMock()%0A        content_type = 'application/thraud+xml'%0A        initial_response = HttpResponse(content=b'0x0', content_type=content_type)%0A        processed_response = self.middleware.process_response(%0A            request=request,%0A            response=initial_response,%0A        )%0A        self.assertEqual(processed_response, initial_response)%0A%0A    def test_other_request_path_info(self):%0A        request = MagicMock()%0A        request.META%5B'PATH_INFO'%5D = '/another-url/'%0A        content_type = 'text/html'%0A        initial_response = HttpResponse(content=b'0x0', content_type=content_type)%0A        processed_response = self.middleware.process_response(%0A            request=request,%0A            response=initial_response,%0A        )%0A        self.assertEqual(processed_response, initial_response)%0A

Add basic tests for middleware