block user in django admin
This commit is contained in:
1 parent
089db0afa4
commit
fe7a10cb61
19 files changed
+574
-11
No files matched your search
@@ -0,0 +1,25 @@
|
||||
from django.urls import reverse
|
||||
from playwright.sync_api import expect
|
||||
|
||||
from tests.e2e.pages.auth import AuthenticationPage
|
||||
|
||||
|
||||
class CustomerLoginAccessPage(AuthenticationPage):
|
||||
def request_otp(self, mobile):
|
||||
self.goto(reverse("accounts:login"))
|
||||
self.page.get_by_label("شماره موبایل").fill(mobile)
|
||||
self.page.get_by_role("button", name="دریافت کد یکبارمصرف").click()
|
||||
|
||||
def assert_block_reason(self, reason):
|
||||
alert = self.page.get_by_role("alert")
|
||||
expect(alert).to_contain_text("ورود به حساب شما مسدود است")
|
||||
expect(alert).to_contain_text(reason)
|
||||
expect(alert).to_be_visible()
|
||||
assert alert.locator(".customer-login-block-reason").evaluate(
|
||||
"node => getComputedStyle(node).color"
|
||||
) == "rgb(153, 27, 27)"
|
||||
assert self.page.evaluate("document.documentElement.scrollWidth <= innerWidth + 1")
|
||||
|
||||
def assert_logged_out(self, reason):
|
||||
expect(self.page).to_have_url(self.url(reverse("accounts:login")), timeout=20000)
|
||||
self.assert_block_reason(reason)
|
||||
Reference in new issue
Block a user