Skip to content

Commit

Permalink
double check magic is not show in live mode
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Nov 18, 2024
1 parent 4ba2f4a commit bb2d297
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lacommunaute/users/tests/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ def test_post(
content = parse_response_to_soup(response, selector="main")
assert str(content) == snapshot(name="login_view_content")

# double check login link is not visible in live mode
pattern = r'http.*?next=%2Ftopics%2F"'
assert re.search(pattern, str(content)) is None

payload_as_str = respx.calls[0].request.content.decode()
assert validate_magiclink_payload(payload_as_str, uidb64, token, expected)

Expand Down Expand Up @@ -206,6 +210,10 @@ def test_post_new_email(
content = parse_response_to_soup(response, selector="main")
assert str(content) == snapshot(name="create_user_view_content")

# double check login link is not visible in live mode
pattern = r'http.*?next=%2Ftopics%2F"'
assert re.search(pattern, str(content)) is None

created_user = User.objects.get(email=email)
assert created_user.email == email
assert created_user.first_name == "John"
Expand Down

0 comments on commit bb2d297

Please sign in to comment.