fix: detect shopee accounts login page
This commit is contained in:
@@ -339,6 +339,25 @@ class EditorLoginTests(unittest.TestCase):
|
||||
self.assertEqual("LOGIN_PAGE", status["reason"])
|
||||
self.assertEqual([], FakeCDP.instances)
|
||||
|
||||
def test_login_status_false_for_accounts_seller_login_url(self):
|
||||
login_url = "https://accounts.shopee.tw/seller/login?next=https%3A%2F%2Fseller.shopee.tw%2Fportal"
|
||||
with mock.patch(
|
||||
"app.editor.http_get",
|
||||
return_value=[
|
||||
{
|
||||
"type": "page",
|
||||
"url": login_url,
|
||||
"webSocketDebuggerUrl": "ws-login",
|
||||
}
|
||||
],
|
||||
):
|
||||
status = editor.login_status({"debug_port": 9222}, timeout=0)
|
||||
|
||||
self.assertFalse(status["logged_in"])
|
||||
self.assertEqual("LOGIN_PAGE", status["reason"])
|
||||
self.assertEqual(login_url, status["url"])
|
||||
self.assertEqual([], FakeCDP.instances)
|
||||
|
||||
def test_login_status_true_with_session_cookie(self):
|
||||
with mock.patch(
|
||||
"app.editor.http_get",
|
||||
|
||||
Reference in New Issue
Block a user