mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-17 04:59:37 -04:00
convert to test fixture
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import base64
|
||||
import copy
|
||||
import json
|
||||
import os
|
||||
@@ -1901,6 +1902,25 @@ def sample_invite(mocker, service_one):
|
||||
)
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def encoded_invite_data():
|
||||
"""
|
||||
This mimics what API does when it encodes invite data in
|
||||
service_invite/rest.py
|
||||
"""
|
||||
invite_data = {
|
||||
"service_id": "service",
|
||||
"invited_user_id": "invited_user",
|
||||
"permissions": ["manage_everything"],
|
||||
"folder_permissions": [],
|
||||
"from_user_id": "xyz",
|
||||
}
|
||||
invite_data = json.dumps(invite_data)
|
||||
invite_data = invite_data.encode("utf8")
|
||||
invite_data = base64.b64encode(invite_data)
|
||||
return invite_data.decode("utf8")
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def expired_invite(service_one):
|
||||
id_ = USER_ONE_ID
|
||||
|
||||
Reference in New Issue
Block a user