[Fix] Fixed failing frontend tests due to renaming (#335)

Co-authored-by: Tim Lorsbach <tim@lorsba.ch>
Reviewed-on: enviPath/enviPy#335
This commit is contained in:
2026-02-17 03:09:32 +13:00
parent 5150027f0d
commit 0ff046363c
3 changed files with 7 additions and 5 deletions

View File

@ -245,7 +245,9 @@ def register(request):
context["message"] = "Invalid username/email/password"
return render(request, "static/login.html", context)
if UnicodeUsernameValidator(username) is not None:
try:
UnicodeUsernameValidator()(username)
except ValidationError:
context["message"] = (
"Enter a valid username. This value may contain only letters, "
"numbers, and @/./+/-/_ characters."

View File

@ -58,8 +58,8 @@ class EnviPyStaticLiveServerTestCase(StaticLiveServerTestCase):
def login(self):
"""Sign in with the test user, 'user0'"""
self.page.goto(self.live_server_url + "/login")
self.page.get_by_role("textbox", name="Username").click()
self.page.get_by_role("textbox", name="Username").fill(self.username)
self.page.get_by_role("textbox", name="Account").click()
self.page.get_by_role("textbox", name="Account").fill(self.username)
self.page.get_by_role("textbox", name="Password").click()
self.page.get_by_role("textbox", name="Password").fill(self.password)

View File

@ -36,8 +36,8 @@ class TestLoginPage(EnviPyStaticLiveServerTestCase):
u.is_active = True
u.save()
page.get_by_role("textbox", name="Username").click()
page.get_by_role("textbox", name="Username").fill("newuser")
page.get_by_role("textbox", name="Account").click()
page.get_by_role("textbox", name="Account").fill("newuser")
page.get_by_role("textbox", name="Password").click()
page.get_by_role("textbox", name="Password").fill("NewUser_1")
page.get_by_role("button", name="Sign In").click()