This repository has been archived by the owner on Dec 18, 2024. It is now read-only.
generated from communitiesuk/funding-service-design-TEMPLATE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b9cec2
commit ec68569
Showing
4 changed files
with
1 addition
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,5 @@ | |
], | ||
"python.testing.unittestEnabled": false, | ||
"python.testing.pytestEnabled": true, | ||
"ruff.enable": false, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,6 @@ | |
from api.session.auth_session import AuthSessionView | ||
from app import app | ||
from bs4 import BeautifulSoup | ||
from config import Config | ||
from frontend.magic_links.forms import EmailForm | ||
from models.account import AccountMethods | ||
from security.utils import validate_token | ||
|
@@ -219,30 +218,6 @@ def test_invalid_magic_link_returns_link_expired(self, flask_test_client): | |
assert b"Link expired" in response.data | ||
assert b"Request a new link" in response.data | ||
|
||
@mock.patch.object(Config, "FLASK_ENV", "production") | ||
def test_search_magic_link_forbidden_on_production(self, flask_test_client): | ||
use_endpoint = "/magic-links" | ||
response = flask_test_client.get(use_endpoint, follow_redirects=True) | ||
assert response.status_code == 403 | ||
|
||
def test_search_magic_link_returns_magic_links(self, flask_test_client): | ||
with mock.patch("models.fund.FundMethods.get_fund"), mock.patch("models.account.get_round_data"), mock.patch( | ||
"frontend.magic_links.routes.get_round_data" | ||
): | ||
payload = { | ||
"email": "[email protected]", | ||
"redirectUrl": "https://example.com/redirect-url", | ||
} | ||
endpoint = "/service/magic-links/new?fund=cof&round=r2w3" | ||
|
||
flask_test_client.post(endpoint, data=payload) | ||
|
||
endpoint = "/magic-links" | ||
get_response = flask_test_client.get(endpoint) | ||
assert get_response.status_code == 200 | ||
assert "account:usernew" in get_response.get_json() | ||
assert next(x for x in get_response.get_json() if x.startswith("link:")) is not None | ||
|
||
def test_assessor_roles_is_empty_via_magic_link_auth(self): | ||
""" | ||
GIVEN we are on the production environment | ||
|