Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
8816b854
Commit
8816b854
authored
Apr 06, 2017
by
Omar Al-Ithawi
Committed by
Renzo Lucioni
Jul 10, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the marketing contact us page in email confirm change message
parent
071f35ba
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
7 deletions
+33
-7
common/djangoapps/student/tests/test_email.py
+20
-1
common/test/test_sites/test_site/templates/emails/confirm_email_change.txt
+5
-3
lms/templates/emails/confirm_email_change.txt
+8
-3
No files found.
common/djangoapps/student/tests/test_email.py
View file @
8816b854
...
...
@@ -9,7 +9,7 @@ from django.core import mail
from
django.core.urlresolvers
import
reverse
from
django.db
import
transaction
from
django.http
import
HttpResponse
from
django.test
import
TestCase
,
TransactionTestCase
from
django.test
import
override_settings
,
TestCase
,
TransactionTestCase
from
django.test.client
import
RequestFactory
from
mock
import
Mock
,
patch
...
...
@@ -437,6 +437,25 @@ class EmailChangeConfirmationTests(EmailTestMixin, TransactionTestCase):
)
self
.
assertEquals
(
0
,
PendingEmailChange
.
objects
.
count
())
@unittest.skipUnless
(
settings
.
ROOT_URLCONF
==
'lms.urls'
,
"Test only valid in LMS"
)
@override_settings
(
MKTG_URLS
=
{
'ROOT'
:
'https://dummy-root'
,
'CONTACT'
:
'/help/contact-us'
})
def
test_marketing_contact_link
(
self
,
_email_user
):
context
=
{
'site'
:
'edx.org'
,
'old_email'
:
'old@example.com'
,
'new_email'
:
'new@example.com'
,
}
confirm_email_body
=
render_to_string
(
'emails/confirm_email_change.txt'
,
context
)
# With marketing site disabled, should link to the LMS contact static page.
# The http(s) part was omitted keep the test focused.
self
.
assertIn
(
'://edx.org/contact'
,
confirm_email_body
)
with
patch
.
dict
(
settings
.
FEATURES
,
{
'ENABLE_MKTG_SITE'
:
True
}):
# Marketing site enabled, should link to the marketing site contact page.
confirm_email_body
=
render_to_string
(
'emails/confirm_email_change.txt'
,
context
)
self
.
assertIn
(
'https://dummy-root/help/contact-us'
,
confirm_email_body
)
@patch
(
'student.views.PendingEmailChange.objects.get'
,
Mock
(
side_effect
=
TestException
))
def
test_always_rollback
(
self
,
_email_user
):
connection
=
transaction
.
get_connection
()
...
...
common/test/test_sites/test_site/templates/emails/confirm_email_change.txt
View file @
8816b854
<%! from django.core.urlresolvers import reverse %>
<%! from django.conf import settings %>
<%! from edxmako.shortcuts import render_to_string, marketing_link %>
This is to confirm that you changed the e-mail associated with
Open edX from ${old_email} to ${new_email}. If you
did not make this request, please contact us immediately. Contact
information is listed at:
% if
is_secure
:
https://${ site }${reverse('contact
')}
% if
settings.FEATURES['ENABLE_MKTG_SITE']
:
${marketing_link('CONTACT
')}
% else:
http://${ site }${reverse('contact')}
http://${ site }${reverse('contact')}
% endif
We keep a log of old e-mails, so if this request was unintentional, we
...
...
lms/templates/emails/confirm_email_change.txt
View file @
8816b854
<%! from django.core.urlresolvers import reverse %>
<%! from django.utils.translation import ugettext as _ %>
<%! from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers %>
<%! from edxmako.shortcuts import render_to_string, marketing_link %>
${_("This is to confirm that you changed the e-mail associated with "
"{platform_name} from {old_email} to {new_email}. If you "
"did not make this request, please contact us immediately. Contact "
...
...
@@ -11,10 +12,14 @@ ${_("This is to confirm that you changed the e-mail associated with "
)
}
% if
is_secure
:
https://${ site }${reverse('contact
')}
% if
settings.FEATURES['ENABLE_MKTG_SITE']
:
${marketing_link('CONTACT
')}
% else:
http://${ site }${reverse('contact')}
% if is_secure:
https://${ site }${reverse('contact')}
% else:
http://${ site }${reverse('contact')}
% endif
% endif
${_("We keep a log of old e-mails, so if this request was unintentional, we can investigate.")}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment