mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-06 13:01:50 +02:00
tests: follow_redirects is now the default for post_project
This commit is contained in:
parent
faa43ec2e3
commit
9383b5aa74
1 changed files with 4 additions and 4 deletions
|
@ -2296,13 +2296,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"),
|
||||||
|
@ -2311,13 +2311,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