mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-11 10:28:55 -04:00
try fuzzed org invite test
This commit is contained in:
@@ -4,6 +4,8 @@ import uuid
|
|||||||
import pytest
|
import pytest
|
||||||
from flask import current_app, json
|
from flask import current_app, json
|
||||||
from freezegun import freeze_time
|
from freezegun import freeze_time
|
||||||
|
from hypothesis import given
|
||||||
|
from hypothesis import strategies as st
|
||||||
from sqlalchemy import select
|
from sqlalchemy import select
|
||||||
|
|
||||||
from app import db
|
from app import db
|
||||||
@@ -175,15 +177,16 @@ def test_update_org_invited_user_set_status_to_cancelled(
|
|||||||
assert json_resp["data"]["status"] == InvitedUserStatus.CANCELLED
|
assert json_resp["data"]["status"] == InvitedUserStatus.CANCELLED
|
||||||
|
|
||||||
|
|
||||||
def test_update_org_invited_user_for_wrong_service_returns_404(
|
@given(random_user_id=st.uuids(), random_org_id=st.uuids())
|
||||||
admin_request, sample_invited_org_user, fake_uuid
|
def test_fuzz_update_org_invited_user_for_wrong_service_returns_404(
|
||||||
|
admin_request, random_user_id, random_org_id
|
||||||
):
|
):
|
||||||
data = {"status": InvitedUserStatus.CANCELLED}
|
data = {"status": InvitedUserStatus.CANCELLED}
|
||||||
|
|
||||||
json_resp = admin_request.post(
|
json_resp = admin_request.post(
|
||||||
"organization_invite.update_org_invite_status",
|
"organization_invite.update_org_invite_status",
|
||||||
organization_id=fake_uuid,
|
organization_id=random_org_id,
|
||||||
invited_org_user_id=sample_invited_org_user.id,
|
invited_org_user_id=random_user_id,
|
||||||
_data=data,
|
_data=data,
|
||||||
_expected_status=404,
|
_expected_status=404,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user