mocking added thruout apps.lyric.tests.test_views, where UTs mock message sending; status message loop added to base.html below navbar; hardcoded assert and model/view values aligned across lyric app, UTs & FTs

This commit is contained in:
Disco DeDisco
2026-01-30 17:23:07 -05:00
parent 4b1906b1ee
commit 93eb497dec
4 changed files with 57 additions and 28 deletions

View File

@@ -4,11 +4,11 @@ from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from .base import FunctionalTest
TEST_EMAIL = "disco@example.com"
SUBJECT = "a magic link to login to your Dashboard"
TEST_EMAIL = "discoman@example.com"
SUBJECT = "A magic login link to your Dashboard"
class LoginTest(FunctionalTest):
def test_login_using_magic_linl(self):
def test_login_using_magic_link(self):
self.browser.get(self.live_server_url)
self.browser.find_element(By.CSS_SELECTOR, "input[name=email]").send_keys(
TEST_EMAIL, Keys.ENTER
@@ -25,7 +25,7 @@ class LoginTest(FunctionalTest):
self.assertIn(TEST_EMAIL, email.to)
self.assertEqual(email.subject, SUBJECT)
self.assertIn("Use this link to login to your Dashboard", email.body)
self.assertIn("Use this magic link to login to your Dashboard", email.body)
url_search = re.search(r"http://.+/.+$", email.body)
if not url_search:
self.fail(f"Could not find url in email body:\n{email.body}")