dthonon / Client_API_VN

Export from VisioNature (Biolovision) web site to local postgresql database
GNU General Public License v3.0
3 stars 1 forks source link

observations_search fails #102

Closed dthonon closed 2 years ago

dthonon commented 4 years ago

During unit tests, no data returned:

    def test_observations_search_2():
        """Query sightings, from taxo_group 18: Mantodea and date range."""
        q_param = {
            "period_choice": "range",
            "date_from": "01.09.2017",
            "date_to": "30.09.2017",
            "species_choice": "all",
            "taxonomic_group": "18",
        }
        list = OBSERVATIONS_API.api_search(q_param, short_version="1")
        assert OBSERVATIONS_API.transfer_errors == 0
        if SITE == "t38":
            assert len(list["data"]["sightings"]) >= 17
        elif SITE == "t07":
>           assert len(list["data"]["sightings"]) >= 3
E           KeyError: 'data'

tests/test_biolovision_api.py:700: KeyError
dthonon commented 4 years ago

mentioned in commit 5fb45c978dc65292dfc72bcb3aab30abf6680707

dthonon commented 4 years ago

Corrected in 5fb45c978dc65292dfc72bcb3aab30abf6680707. Regression due to POST request over-simplification

dthonon commented 4 years ago

closed

dthonon commented 4 years ago

mentioned in commit 7cc681aef73fb5feb1583476e03b3ab2c75841fe