Browse Source

mass_mailing_custom_unsubscribe: Fix testing error

Fix assertIn error thrown in testing mode
pull/287/head
ernesto 7 years ago
parent
commit
9f124542a2
  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 import mock
from contextlib import contextmanager from contextlib import contextmanager
from odoo.tests.common import HttpCase from odoo.tests.common import HttpCase
from werkzeug import urls
class UICase(HttpCase): class UICase(HttpCase):
@ -11,7 +12,7 @@ class UICase(HttpCase):
def extract_url(self, mail, *args, **kwargs): def extract_url(self, mail, *args, **kwargs):
url = mail._get_unsubscribe_url(self.email) 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.assertTrue(url.startswith(self.domain))
self.url = url.replace(self.domain, "", 1) self.url = url.replace(self.domain, "", 1)
return True return True

Loading…
Cancel
Save