api_client = <rest_framework.test.APIClient object at 0x7f8628d64c50>
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_list_moderator(
api_client, regular_user, add_forge_moderator
):
url = reverse("api-1-add-forge-request-list")
create_add_forge_request(api_client, regular_user)
create_add_forge_request(api_client, regular_user, data=ADD_FORGE_DATA_FORGE2)
api_client.force_login(add_forge_moderator)
resp = check_api_get_responses(api_client, url, status_code=200)
add_forge_request = {
**ADD_FORGE_DATA_FORGE1,
"status": "PENDING",
"submission_date": resp.data[1]["submission_date"],
"submitter_name": regular_user.username,
"submitter_email": regular_user.email,
"id": 1,
}
other_forge_request = {
**ADD_FORGE_DATA_FORGE2,
"status": "PENDING",
"submission_date": resp.data[0]["submission_date"],
"submitter_name": regular_user.username,
"submitter_email": regular_user.email,
"id": 2,
}
> assert resp.data == [other_forge_request, add_forge_request]
E AssertionError: assert [{'forge_cont...gitlab', ...}] == [{'forge_cont...gitlab', ...}]
E At index 0 diff: {'id': 2, 'moderator': 'None', 'last_modified_date': '2022-05-02T11:09:23.910409Z', 'status': 'PENDING', 'submission_date': '2022-05-02T11:09:23.909745Z', 'submitter_name': 'johndoe', 'submitter_email': '', 'submitter_forward_username': True, 'forge_type': 'gitea', 'forge_url': 'https://gitea.example.org', 'forge_contact_email': 'admin@gitea.example.org', 'forge_contact_name': 'gitea.example.org admin', 'forge_contact_comment': 'user marked as owner in forge members'} != {'forge_type': 'gitea', 'forge_url': 'https://gitea.example.org', 'forge_contact_em...
E
E ...Full output truncated (30 lines hidden), use '-vv' to show
.tox/py3/lib/python3.7/site-packages/swh/web/tests/api/views/test_add_forge_now.py:383: AssertionError
TEST RESULT
TEST RESULT
- Run At
- May 2 2022, 1:32 PM