fix for functional_tests.test_login, which still relied on old mock logic, no longer in apps.lyric.views, but handled by celery in apps.lyric.tasks
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
from selenium.webdriver.common.keys import Keys
|
from selenium.webdriver.common.keys import Keys
|
||||||
|
|
||||||
from .base import FunctionalTest
|
from .base import FunctionalTest
|
||||||
|
from apps.lyric.tasks import send_login_email_task
|
||||||
|
|
||||||
|
|
||||||
TEST_EMAIL = "discoman@example.com"
|
TEST_EMAIL = "discoman@example.com"
|
||||||
@@ -11,8 +13,10 @@ SUBJECT = "A magic login link to your Dashboard"
|
|||||||
|
|
||||||
|
|
||||||
class LoginTest(FunctionalTest):
|
class LoginTest(FunctionalTest):
|
||||||
@patch('apps.lyric.views.requests.post')
|
@patch('apps.lyric.tasks.requests.post')
|
||||||
def test_login_using_magic_link(self, mock_post):
|
@patch('apps.lyric.views.send_login_email_task.delay',
|
||||||
|
side_effect=send_login_email_task)
|
||||||
|
def test_login_using_magic_link(self, mock_delay, mock_post):
|
||||||
# Mock successful Mailgun API response
|
# Mock successful Mailgun API response
|
||||||
mock_post.return_value.status_code = 200
|
mock_post.return_value.status_code = 200
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user