mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-02 11:12:23 +02:00
tests: follow_redirects is now the default for post_project
This commit is contained in:
parent
381ea8fe0c
commit
8d9dc6a61f
1 changed files with 4 additions and 4 deletions
|
@ -1641,13 +1641,13 @@ class EmailFailureTestCase(IhatemoneyTestCase):
|
||||||
with patch.object(
|
with patch.object(
|
||||||
self.app.mail, "send", MagicMock(side_effect=smtplib.SMTPException)
|
self.app.mail, "send", MagicMock(side_effect=smtplib.SMTPException)
|
||||||
):
|
):
|
||||||
resp = self.post_project("raclette", follow_redirects=True)
|
resp = self.post_project("raclette")
|
||||||
# Check that an error message is displayed
|
# Check that an error message is displayed
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
"We tried to send you an reminder email, but there was an error",
|
"We tried to send you an reminder email, but there was an error",
|
||||||
resp.data.decode("utf-8"),
|
resp.data.decode("utf-8"),
|
||||||
)
|
)
|
||||||
# Check that we are redirected anyway
|
# Check that we were redirected to the home page anyway
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
'You probably want to <a href="/raclette/members/add"',
|
'You probably want to <a href="/raclette/members/add"',
|
||||||
resp.data.decode("utf-8"),
|
resp.data.decode("utf-8"),
|
||||||
|
@ -1656,13 +1656,13 @@ class EmailFailureTestCase(IhatemoneyTestCase):
|
||||||
def test_creation_email_failure_socket(self):
|
def test_creation_email_failure_socket(self):
|
||||||
self.login("raclette")
|
self.login("raclette")
|
||||||
with patch.object(self.app.mail, "send", MagicMock(side_effect=socket.error)):
|
with patch.object(self.app.mail, "send", MagicMock(side_effect=socket.error)):
|
||||||
resp = self.post_project("raclette", follow_redirects=True)
|
resp = self.post_project("raclette")
|
||||||
# Check that an error message is displayed
|
# Check that an error message is displayed
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
"We tried to send you an reminder email, but there was an error",
|
"We tried to send you an reminder email, but there was an error",
|
||||||
resp.data.decode("utf-8"),
|
resp.data.decode("utf-8"),
|
||||||
)
|
)
|
||||||
# Check that we are redirected anyway
|
# Check that we were redirected to the home page anyway
|
||||||
self.assertIn(
|
self.assertIn(
|
||||||
'You probably want to <a href="/raclette/members/add"',
|
'You probably want to <a href="/raclette/members/add"',
|
||||||
resp.data.decode("utf-8"),
|
resp.data.decode("utf-8"),
|
||||||
|
|
Loading…
Reference in a new issue