Пример #1
0
    def test_minimum_range_returned(self):
        areas = CellAreaFactory.create_batch(2)
        areas[0].range = LAC_MIN_ACCURACY - 2000
        areas[1].range = LAC_MIN_ACCURACY + 3000
        areas[1].lat = areas[0].lat + 0.2
        self.session.flush()

        query = self.model_query(cells=areas)
        location = self.provider.locate(query)
        self.check_model_location(location, areas[0], accuracy=LAC_MIN_ACCURACY)
Пример #2
0
    def test_minimum_radius(self, geoip_db, http_session, session, source):
        areas = CellAreaFactory.create_batch(2)
        areas[0].radius = CELLAREA_MIN_ACCURACY - 2000
        areas[1].radius = CELLAREA_MIN_ACCURACY + 3000
        areas[1].lat = areas[0].lat + 0.2
        session.flush()

        query = self.model_query(geoip_db, http_session, session, cells=areas)
        results = source.search(query)
        self.check_model_results(results, [areas[0]],
                                 accuracy=CELLAREA_MIN_ACCURACY)
Пример #3
0
    def test_minimum_radius(self):
        areas = CellAreaFactory.create_batch(2)
        areas[0].radius = CELLAREA_MIN_ACCURACY - 2000
        areas[1].radius = CELLAREA_MIN_ACCURACY + 3000
        areas[1].lat = areas[0].lat + 0.2
        self.session.flush()

        query = self.model_query(cells=areas)
        results = self.source.search(query)
        self.check_model_results(
            results, [areas[0]], accuracy=CELLAREA_MIN_ACCURACY)
Пример #4
0
    def test_minimum_range(self):
        areas = CellAreaFactory.create_batch(2)
        areas[0].range = LAC_MIN_ACCURACY - 2000
        areas[1].range = LAC_MIN_ACCURACY + 3000
        areas[1].lat = areas[0].lat + 0.2
        self.session.flush()

        query = self.model_query(cells=areas)
        result = self.source.search(query)
        self.check_model_result(
            result, areas[0],
            accuracy=LAC_MIN_ACCURACY)
Пример #5
0
    def test_minimum_radius(self):
        areas = CellAreaFactory.create_batch(2)
        areas[0].radius = CELLAREA_MIN_ACCURACY - 2000
        areas[1].radius = CELLAREA_MIN_ACCURACY + 3000
        areas[1].lat = areas[0].lat + 0.2
        self.session.flush()

        query = self.model_query(cells=areas)
        result = self.source.search(query)
        self.check_model_result(
            result, areas[0],
            accuracy=CELLAREA_MIN_ACCURACY)