@@ -0,0 +1,1638 @@
+from mock import patch, Mock%0A%0Afrom django_webtest import WebTest%0A%0A@patch('candidates.views.PopIt')%0A@patch('candidates.views.requests')%0Aclass TestAutocompletePartyView(WebTest):%0A%0A    def test_autocomplete(self, mock_requests, mock_popit):%0A        fake_search_result = %7B%0A            %22total%22: 9,%0A            %22page%22: 1,%0A            %22per_page%22: 30,%0A            %22has_more%22: False,%0A            %22result%22: %5B%0A                %7B%22name%22: %22Socialist Labour Party%22%7D,%0A                %7B%22name%22: %22Labour Party%22%7D,%0A                %7B%22name%22: %22Democratic Labour Party%22%7D,%0A                %7B%22name%22: %22Labour and Co-operative%22%7D,%0A                %7B%22name%22: %22The Labour Party%22%7D,%0A                %7B%22name%22: %22Labour Party of Northern Ireland%22%7D,%0A                %7B%22name%22: %22SDLP (Social Democratic & Labour Party)%22%7D,%0A                %7B%22name%22: %22The Individuals Labour and Tory (TILT)%22%7D,%0A                %7B%22name%22: %22Liverpool Labour Community Party%22%7D,%0A            %5D,%0A        %7D%0A        mock_requests.get.return_value = Mock(**%7B%0A            'json.return_value': fake_search_result%0A        %7D)%0A        response = self.app.get('/autocomplete/party?term=lab')%0A        self.assertEqual(%0A            response.json,%0A            %5B%0A                %22lab%22,%0A                %22Labour Party%22,%0A                %22Socialist Labour Party%22,%0A                %22SDLP (Social Democratic & Labour Party)%22,%0A                %22Democratic Labour Party%22,%0A                %22The Labour Party%22,%0A                %22Labour and Co-operative%22,%0A                %22Labour Party of Northern Ireland%22,%0A                %22The Individuals Labour and Tory (TILT)%22,%0A                %22Liverpool Labour Community Party%22%0A            %5D%0A        )%0A

Add a test for the party autocomplete view