mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-18 13:39:41 -04:00
Add button to cancel invitation of invited user.
This commit is contained in:
@@ -30,7 +30,7 @@ def test_should_show_page_for_one_user(
|
||||
with app_.test_request_context():
|
||||
with app_.test_client() as client:
|
||||
client.login(api_user_active)
|
||||
response = client.get(url_for('main.edit_user', service_id=55555, user_id=0))
|
||||
response = client.get(url_for('main.edit_user_permissions', service_id=55555, user_id=0))
|
||||
|
||||
assert response.status_code == 200
|
||||
|
||||
@@ -47,7 +47,7 @@ def test_redirect_after_saving_user(
|
||||
with app_.test_client() as client:
|
||||
client.login(api_user_active)
|
||||
response = client.post(url_for(
|
||||
'main.edit_user', service_id=55555, user_id=0
|
||||
'main.edit_user_permissions', service_id=55555, user_id=0
|
||||
))
|
||||
|
||||
assert response.status_code == 302
|
||||
@@ -104,3 +104,18 @@ def test_should_show_page_for_inviting_user(
|
||||
# assert page.h1.string.strip() == 'Manage team'
|
||||
# flash_banner = page.find('div', class_='banner-default-with-tick').string.strip()
|
||||
# assert flash_banner == 'Invite sent to test@example.gov.uk'
|
||||
|
||||
|
||||
def test_cancel_invited_user_cancels_user_invitations(app_, api_user_active, mock_login, mocker):
|
||||
with app_.test_request_context():
|
||||
with app_.test_client() as client:
|
||||
mocker.patch('app.invite_api_client.cancel_invited_user')
|
||||
import uuid
|
||||
invited_user_id = uuid.uuid4()
|
||||
client.login(api_user_active)
|
||||
service_id = uuid.uuid4()
|
||||
response = client.post(url_for('main.cancel_invited_user', service_id=service_id,
|
||||
invited_user_id=invited_user_id))
|
||||
|
||||
assert response.status_code == 302
|
||||
assert response.location == url_for('main.manage_users', service_id=service_id, _external=True)
|
||||
|
||||
Reference in New Issue
Block a user