This repository has been archived on 2024-02-02. You can view files and clone it, but cannot push or open issues or pull requests.
passerelle-reunion-fsn/tests/test_connector.py

37 lines
995 B
Python

# -*- coding: utf-8 -*-
from django.contrib.contenttypes.models import ContentType
from django.core.cache import cache
import django_webtest
import pytest
from passerelle_reunion_fsn.models import FSNReunionConnector
from passerelle.base.models import ApiUser, AccessRight
@pytest.fixture
def app(request):
wtm = django_webtest.WebTestMixin()
wtm._patch_settings()
cache.clear()
yield django_webtest.DjangoTestApp()
wtm._unpatch_settings()
@pytest.fixture
def connector(db):
connector = FSNReunionConnector.objects.create(
slug='test', api_url='https://whatever', token='token', demarche_number=1,
instructeur_id='xxxx'
)
api = ApiUser.objects.create(username='all', keytype='', key='')
obj_type = ContentType.objects.get_for_model(connector)
AccessRight.objects.create(
codename='can_access', apiuser=api,
resource_type=obj_type, resource_pk=connector.pk)
def test_dummny(app, connector):
assert True