コード例 #1
0
ファイル: test_siren.py プロジェクト: mxdev88/api_insee
def test_siren_search_with_period_variable(api, execute_request):

    request = api.siren(
        q=Criteria.PeriodicField('etatAdministratifUniteLegale','C')
    )

    assert request.url == base_siren_url + '?q=periode(etatAdministratifUniteLegale:C)'

    execute_request(request)
コード例 #2
0
def test_siren_search_with_periodic_list_and_operators_excluding():

    request = api.siren(
        q=Criteria.Periodic(
            Criteria.Field('activitePrincipaleUniteLegale', '84.23Z')
            | Criteria.Field('activitePrincipaleUniteLegale', '86.21Z'))
        & Criteria.PeriodicField('activitePrincipaleUniteLegale', '87.21Z'))

    assert request.url == base_siren_url + '/?q=periode(activitePrincipaleUniteLegale:84.23Z OR activitePrincipaleUniteLegale:86.21Z) AND periode(activitePrincipaleUniteLegale:87.21Z)'
コード例 #3
0
ファイル: test_siret.py プロジェクト: CamTosh/api_insee
def test_siret_search_with_periodic_list_and_operators_excluding(execute_request):

    request = api.siret(
        q= Criteria.Periodic(
            Criteria.Field('activitePrincipaleEtablissement','84.23Z') |
            Criteria.Field('activitePrincipaleEtablissement','86.21Z')
        ) &
        Criteria.PeriodicField('etatAdministratifEtablissement','A')
    )

    assert request.url == base_siret_url + '?q=periode(activitePrincipaleEtablissement:84.23Z OR activitePrincipaleEtablissement:86.21Z) AND periode(etatAdministratifEtablissement:A)'

    execute_request(request)