Browse Source

Merge pull request #287 from ernestotejeda/11.0-fixbug-testing-mass_mailing_custom_unsubscribe

mass_mailing_custom_unsubscribe: Fix testing error
pull/284/head
Pedro M. Baeza 6 years ago
committed by GitHub
parent
commit
aaa3cb506d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      mass_mailing_custom_unsubscribe/tests/test_ui.py

3
mass_mailing_custom_unsubscribe/tests/test_ui.py

@ -3,6 +3,7 @@
import mock
from contextlib import contextmanager
from odoo.tests.common import HttpCase
from werkzeug import urls
class UICase(HttpCase):
@ -11,7 +12,7 @@ class UICase(HttpCase):
def extract_url(self, mail, *args, **kwargs):
url = mail._get_unsubscribe_url(self.email)
self.assertIn("&token=", url)
self.assertTrue(urls.url_parse(url).decode_query().get('token'))
self.assertTrue(url.startswith(self.domain))
self.url = url.replace(self.domain, "", 1)
return True

Loading…
Cancel
Save