mirror of
https://github.com/GSA/notifications-api.git
synced 2026-09-02 17:48:36 -04:00
Rebased migrations, all tests working.
This commit is contained in:
@@ -177,7 +177,7 @@ def test_create_service(notify_api, sample_user):
|
||||
with notify_api.test_client() as client:
|
||||
data = {
|
||||
'name': 'created service',
|
||||
'user_id': sample_user.id,
|
||||
'user_id': str(sample_user.id),
|
||||
'limit': 1000,
|
||||
'restricted': False,
|
||||
'active': False,
|
||||
@@ -238,12 +238,15 @@ def test_should_not_create_service_with_missing_user_id_field(notify_api):
|
||||
assert 'Missing data for required field.' in json_resp['message']['user_id']
|
||||
|
||||
|
||||
def test_should_not_create_service_with_missing_if_user_id_is_not_in_database(notify_api, notify_db, notify_db_session):
|
||||
def test_should_not_create_service_with_missing_if_user_id_is_not_in_database(notify_api,
|
||||
notify_db,
|
||||
notify_db_session,
|
||||
fake_uuid):
|
||||
with notify_api.test_request_context():
|
||||
with notify_api.test_client() as client:
|
||||
data = {
|
||||
'email_from': 'service',
|
||||
'user_id': 1234,
|
||||
'user_id': fake_uuid,
|
||||
'name': 'created service',
|
||||
'limit': 1000,
|
||||
'restricted': False,
|
||||
@@ -269,7 +272,7 @@ def test_should_not_create_service_if_missing_data(notify_api, sample_user):
|
||||
with notify_api.test_request_context():
|
||||
with notify_api.test_client() as client:
|
||||
data = {
|
||||
'user_id': sample_user.id
|
||||
'user_id': str(sample_user.id)
|
||||
}
|
||||
auth_header = create_authorization_header(
|
||||
path='/service',
|
||||
@@ -299,7 +302,7 @@ def test_should_not_create_service_with_duplicate_name(notify_api,
|
||||
with notify_api.test_client() as client:
|
||||
data = {
|
||||
'name': sample_service.name,
|
||||
'user_id': sample_service.users[0].id,
|
||||
'user_id': str(sample_service.users[0].id),
|
||||
'limit': 1000,
|
||||
'restricted': False,
|
||||
'active': False,
|
||||
@@ -327,7 +330,7 @@ def test_create_service_should_throw_duplicate_key_constraint_for_existing_email
|
||||
with notify_api.test_client() as client:
|
||||
data = {
|
||||
'name': 'First SERVICE',
|
||||
'user_id': first_service.users[0].id,
|
||||
'user_id': str(first_service.users[0].id),
|
||||
'limit': 1000,
|
||||
'restricted': False,
|
||||
'active': False,
|
||||
@@ -543,7 +546,7 @@ def test_default_permissions_are_added_for_user_service(notify_api,
|
||||
with notify_api.test_client() as client:
|
||||
data = {
|
||||
'name': 'created service',
|
||||
'user_id': sample_user.id,
|
||||
'user_id': str(sample_user.id),
|
||||
'limit': 1000,
|
||||
'restricted': False,
|
||||
'active': False,
|
||||
@@ -650,7 +653,7 @@ def test_add_existing_user_to_another_service_with_all_permissions(notify_api,
|
||||
)
|
||||
assert resp.status_code == 200
|
||||
json_resp = json.loads(resp.get_data(as_text=True))
|
||||
assert user_to_add.id in json_resp['data']['users']
|
||||
assert str(user_to_add.id) in json_resp['data']['users']
|
||||
|
||||
# check user has all permissions
|
||||
auth_header = create_authorization_header(
|
||||
|
||||
Reference in New Issue
Block a user