def test_search_filter_range(self):
        """
        Tests search_buidlings method when called with a range.
        """
        # arrange
        NUMBER_ACTIVE = 10  # if more than 10, then alpha sort puts 11 before 2
        NUMBER_PER_PAGE = 10
        for i in range(NUMBER_ACTIVE):
            cb = CanonicalBuilding(active=True)
            cb.save()
            b = SEEDFactory.building_snapshot(
                canonical_building=cb,
                tax_lot_id=i % "%s",
                year_built=(i + 1)
            )
            cb.canonical_snapshot = b
            cb.save()
            b.super_organization = self.org
            b.save()
        url = reverse_lazy("seed:search_buildings")
        post_data = {
            'filter_params': {
                # should return 3 buildings with years built of:
                # 5, 6, and 7
                'year_built__gte': 5,
                'year_built__lte': 7
            },
            'number_per_page': NUMBER_PER_PAGE,
            'order_by': 'year_built',
            'page': 1,
            'q': '',
            'sort_reverse': False,
            'project_id': None,
        }

        # act
        response = self.client.post(
            url,
            content_type='application/json',
            data=json.dumps(post_data)
        )
        json_string = response.content
        data = json.loads(json_string)

        # assert
        self.assertEqual(data['status'], 'success')
        self.assertEqual(data['number_matching_search'], 3)
        self.assertEqual(len(data['buildings']), 3)
        self.assertEqual(data['buildings'][0]['year_built'], 5)
        self.assertEqual(data['buildings'][1]['year_built'], 6)
        self.assertEqual(data['buildings'][2]['year_built'], 7)
dataset/ETHPy150Open buildingenergy/buildingenergy-platform/seed/tests/test_views.py/SearchViewTests.test_search_filter_range/swapped operands of `%`