@patch.object(views.Group.objects, 'search')
    def test_coords_and_query(self, mock_search):
        self.assertEqual(mock_search.call_count, 0)
        request = self.request_factory.get('/?location=1,1&q=something')
        request.user = self.user1
        self.view(request)
        self.assertEqual(
            mock_search.call_args,
            call(
                search=u'something',
                location=(Decimal('1'), Decimal('1'))
            )
        )
        self.assertEqual(mock_search.call_count, 1)
Location and search are passed when in request query string.
dataset/ETHPy150Open ofa/connect/open_connect/groups/tests/test_views.py/GroupListViewTest.test_coords_and_query