mirror of https://github.com/OCA/social.git
Merge pull request #287 from ernestotejeda/11.0-fixbug-testing-mass_mailing_custom_unsubscribe
mass_mailing_custom_unsubscribe: Fix testing errorpull/284/head
commit
aaa3cb506d
|
@ -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…
Reference in New Issue