mirror of
https://github.com/Tech-Workers-Coalition-Italia/mobilizon-reshare.git
synced 2025-01-30 17:14:53 +01:00
489e3d66ad
* Fix PublisherCoordinatorReport generation. Without this patch we are given *either* the failed or the successful publication reports. We actually need both, this patch implements the merge. * Reformat Co-authored-by: Giacomo Leidi <goodoldpaul@autistici.org>
37 lines
743 B
Python
37 lines
743 B
Python
import pytest
|
|
import responses
|
|
|
|
from mobilizon_reshare.config.config import get_settings
|
|
|
|
|
|
@pytest.fixture
|
|
def mobilizon_url():
|
|
return get_settings()["source"]["mobilizon"]["url"]
|
|
|
|
|
|
@responses.activate
|
|
@pytest.fixture
|
|
def mock_mobilizon_success_answer(mobilizon_answer, mobilizon_url):
|
|
with responses.RequestsMock() as rsps:
|
|
|
|
rsps.add(
|
|
responses.POST,
|
|
mobilizon_url,
|
|
json=mobilizon_answer,
|
|
status=200,
|
|
)
|
|
yield
|
|
|
|
|
|
@responses.activate
|
|
@pytest.fixture
|
|
def mock_mobilizon_failure_answer(mobilizon_url):
|
|
with responses.RequestsMock() as rsps:
|
|
|
|
rsps.add(
|
|
responses.POST,
|
|
mobilizon_url,
|
|
status=500,
|
|
)
|
|
yield
|