api_client = <rest_framework.test.APIClient object at 0x7f86278195c0>
regular_user = <User: johndoe>
add_forge_moderator = <User: add-forge moderator>
@pytest.mark.django_db(transaction=True, reset_sequences=True)
def test_add_forge_request_get_moderator(api_client, regular_user, add_forge_moderator):
resp = create_add_forge_request(api_client, regular_user)
submission_date = resp.data["submission_date"]
url = reverse("api-1-add-forge-request-update", url_args={"id": 1})
api_client.force_login(add_forge_moderator)
check_api_post_response(
api_client,
url,
data={"new_status": "WAITING_FOR_FEEDBACK", "text": "waiting for message"},
status_code=200,
)
url = reverse("api-1-add-forge-request-get", url_args={"id": 1})
resp = check_api_get_responses(api_client, url, status_code=200)
> assert resp.data == {
"request": {
**ADD_FORGE_DATA_FORGE1,
"id": 1,
"status": "WAITING_FOR_FEEDBACK",
"submission_date": submission_date,
"submitter_name": regular_user.username,
"submitter_email": regular_user.email,
},
"history": [
{
"id": 1,
"text": "",
"actor": regular_user.username,
"actor_role": "SUBMITTER",
"date": resp.data["history"][0]["date"],
"new_status": "PENDING",
},
{
"id": 2,
"text": "waiting for message",
"actor": add_forge_moderator.username,
"actor_role": "MODERATOR",
"date": resp.data["history"][1]["date"],
"new_status": "WAITING_FOR_FEEDBACK",
},
],
}
E AssertionError: assert {'history': [...rge members'}} == {'history': [...gitlab', ...}}
E Omitting 1 identical items, use -vv to show
E Differing items:
E {'request': {'id': 1, 'moderator': 'add-forge moderator', 'last_modified_date': '2022-05-02T11:09:25.779844Z', 'status...', 'forge_contact_name': 'gitlab.example.org admin', 'forge_contact_comment': 'user marked as owner in forge members'}} != {'request': {'forge_contact_comment': 'user marked as owner in forge members', 'forge_contact_email': 'admin@gitlab.example.org', 'forge_contact_name': 'gitlab.example.org admin', 'forge_type': 'gitlab', ...}}
E Full diff:
E {
E + 'history': [OrderedDict([('id', 1), ('text', '')...
E
E ...Full output truncated (27 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_add_forge_now.py:504: AssertionError
TEST RESULT
TEST RESULT
- Run At
- May 2 2022, 1:32 PM