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
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
1 deletions
-
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 |
|
|
|