def test_build_search_query(self):
        request = self._request({
            'page': 5,
            'q': 'email',
            'non': 1,
            'newkey': 'true',
            'lot': 'saas',
            'question1': 'true',
            'question3': ['option1', 'option2'],
            'question4': 'true',
            'question6': ['option1', 'option3'],
        })

        assert_equal(
            search_helpers.build_search_query(request, self.lot_filters,
                                              self._loader()),
            {
                'page': 5,
                'q': 'email',
                'lot': 'saas',
                'question1': 'true',
                'question4': 'true',
                'question3': 'option1,option2',
                'question6': ['option1', 'option3'],
            })
    def test_build_search_query(self):
        request = self._request({
            'page': 5,
            'q': 'email',
            'non': 1,
            'newkey': 'true',
            'lot': 'saas',
            'question1': 'true',
            'question3': ['option1', 'option2'],
            'question4': 'true',
            'question6': ['option1', 'option3'],
        })

        assert_equal(
            search_helpers.build_search_query(
                request, self.lot_filters, self._loader()),
            {
                'page': 5,
                'q': 'email',
                'lot': 'saas',
                'question1': 'true',
                'question4': 'true',
                'question3': 'option1,option2',
                'question6': ['option1', 'option3'],
            }
        )
    def test_build_search_query_no_page(self):
        request = self._request({
            'page': '',
        })

        assert_equal(
            search_helpers.build_search_query(request, self.lot_filters,
                                              self._loader()), {})
    def test_build_search_query_multiple_lots(self):
        request = self._request({
            'lot': 'saas,paas',
        })

        assert_equal(
            search_helpers.build_search_query(request, self.lot_filters,
                                              self._loader()), {})
    def test_build_search_query_unknown_lot(self):
        request = self._request({
            'lot': 'saasaas',
        })

        assert_equal(
            search_helpers.build_search_query(request, self.lot_filters,
                                              self._loader()), {})
    def test_build_search_query_g5_dots_id_search(self):
        request = self._request({
            'q': 'some text 5.G4.1005.001',
        })

        assert_equal(
            search_helpers.build_search_query(request, self.lot_filters,
                                              self._loader()),
            {'q': 'some text 5-G4-1005-001'})
    def test_build_search_query_no_page(self):
        request = self._request({
            'page': '',
        })

        assert_equal(
            search_helpers.build_search_query(
                request, self.lot_filters, self._loader()),
            {}
        )
    def test_build_search_query_multiple_lots(self):
        request = self._request({
            'lot': 'saas,paas',
        })

        assert_equal(
            search_helpers.build_search_query(
                request, self.lot_filters, self._loader()),
            {}
        )
    def test_build_search_query_unknown_lot(self):
        request = self._request({
            'lot': 'saasaas',
        })

        assert_equal(
            search_helpers.build_search_query(
                request, self.lot_filters, self._loader()),
            {}
        )
    def test_build_search_query_g5_dots_id_search(self):
        request = self._request({
            'q': 'some text 5.G4.1005.001',
        })

        assert_equal(
            search_helpers.build_search_query(
                request, self.lot_filters, self._loader()),
            {'q': 'some text 5-G4-1005-001'}
        )