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
848e72c7
Commit
848e72c7
authored
Jul 31, 2015
by
Sarina Canelake
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9134 from edx/sarina/allow-logistration-in-microsites
Allow microsites to use logistration page (ECOM-1976)
parents
10a0bc6f
db2d8f65
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
94 additions
and
4 deletions
+94
-4
common/test/test_microsites/microsite_with_logistration/readme.txt
+1
-0
lms/djangoapps/student_account/test/test_views.py
+57
-0
lms/djangoapps/student_account/views.py
+3
-1
lms/envs/test.py
+26
-0
lms/lib/courseware_search/test/test_lms_filter_generator.py
+7
-3
No files found.
common/test/test_microsites/microsite_with_logistration/readme.txt
0 → 100644
View file @
848e72c7
# This is intentionally an empty directory. This is needed for this test microsite to be valid
lms/djangoapps/student_account/test/test_views.py
View file @
848e72c7
...
@@ -459,3 +459,60 @@ class AccountSettingsViewTest(ThirdPartyAuthTestMixin, TestCase):
...
@@ -459,3 +459,60 @@ class AccountSettingsViewTest(ThirdPartyAuthTestMixin, TestCase):
for
attribute
in
self
.
FIELDS
:
for
attribute
in
self
.
FIELDS
:
self
.
assertIn
(
attribute
,
response
.
content
)
self
.
assertIn
(
attribute
,
response
.
content
)
@override_settings
(
SITE_NAME
=
settings
.
MICROSITE_LOGISTRATION_HOSTNAME
)
class
MicrositeLogistrationTests
(
TestCase
):
"""
Test to validate that microsites can display the logistration page
"""
def
test_login_page
(
self
):
"""
Make sure that we get the expected logistration page on our specialized
microsite
"""
resp
=
self
.
client
.
get
(
reverse
(
'account_login'
),
HTTP_HOST
=
settings
.
MICROSITE_LOGISTRATION_HOSTNAME
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertIn
(
'<div id="login-and-registration-container"'
,
resp
.
content
)
def
test_registration_page
(
self
):
"""
Make sure that we get the expected logistration page on our specialized
microsite
"""
resp
=
self
.
client
.
get
(
reverse
(
'account_register'
),
HTTP_HOST
=
settings
.
MICROSITE_LOGISTRATION_HOSTNAME
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertIn
(
'<div id="login-and-registration-container"'
,
resp
.
content
)
@override_settings
(
SITE_NAME
=
settings
.
MICROSITE_TEST_HOSTNAME
)
def
test_no_override
(
self
):
"""
Make sure we get the old style login/registration if we don't override
"""
resp
=
self
.
client
.
get
(
reverse
(
'account_login'
),
HTTP_HOST
=
settings
.
MICROSITE_TEST_HOSTNAME
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertNotIn
(
'<div id="login-and-registration-container"'
,
resp
.
content
)
resp
=
self
.
client
.
get
(
reverse
(
'account_register'
),
HTTP_HOST
=
settings
.
MICROSITE_TEST_HOSTNAME
)
self
.
assertEqual
(
resp
.
status_code
,
200
)
self
.
assertNotIn
(
'<div id="login-and-registration-container"'
,
resp
.
content
)
lms/djangoapps/student_account/views.py
View file @
848e72c7
...
@@ -67,7 +67,9 @@ def login_and_registration_form(request, initial_mode="login"):
...
@@ -67,7 +67,9 @@ def login_and_registration_form(request, initial_mode="login"):
# If this is a microsite, revert to the old login/registration pages.
# If this is a microsite, revert to the old login/registration pages.
# We need to do this for now to support existing themes.
# We need to do this for now to support existing themes.
if
microsite
.
is_request_in_microsite
():
# Microsites can use the new logistration page by setting
# 'ENABLE_COMBINED_LOGIN_REGISTRATION' in their microsites configuration file.
if
microsite
.
is_request_in_microsite
()
and
not
microsite
.
get_value
(
'ENABLE_COMBINED_LOGIN_REGISTRATION'
,
False
):
if
initial_mode
==
"login"
:
if
initial_mode
==
"login"
:
return
old_login_view
(
request
)
return
old_login_view
(
request
)
elif
initial_mode
==
"register"
:
elif
initial_mode
==
"register"
:
...
...
lms/envs/test.py
View file @
848e72c7
...
@@ -415,6 +415,31 @@ MICROSITE_CONFIGURATION = {
...
@@ -415,6 +415,31 @@ MICROSITE_CONFIGURATION = {
"ENABLE_PAID_COURSE_REGISTRATION"
:
True
,
"ENABLE_PAID_COURSE_REGISTRATION"
:
True
,
"SESSION_COOKIE_DOMAIN"
:
"test_microsite.localhost"
,
"SESSION_COOKIE_DOMAIN"
:
"test_microsite.localhost"
,
},
},
"microsite_with_logistration"
:
{
"domain_prefix"
:
"logistration"
,
"university"
:
"logistration"
,
"platform_name"
:
"Test logistration"
,
"logo_image_url"
:
"test_microsite/images/header-logo.png"
,
"email_from_address"
:
"test_microsite@edx.org"
,
"payment_support_email"
:
"test_microsite@edx.org"
,
"ENABLE_MKTG_SITE"
:
False
,
"ENABLE_COMBINED_LOGIN_REGISTRATION"
:
True
,
"SITE_NAME"
:
"test_microsite.localhost"
,
"course_org_filter"
:
"LogistrationX"
,
"course_about_show_social_links"
:
False
,
"css_overrides_file"
:
"test_microsite/css/test_microsite.css"
,
"show_partners"
:
False
,
"show_homepage_promo_video"
:
False
,
"course_index_overlay_text"
:
"Logistration."
,
"course_index_overlay_logo_file"
:
"test_microsite/images/header-logo.png"
,
"homepage_overlay_html"
:
"<h1>This is a Logistration HTML</h1>"
,
"ALWAYS_REDIRECT_HOMEPAGE_TO_DASHBOARD_FOR_AUTHENTICATED_USER"
:
False
,
"COURSE_CATALOG_VISIBILITY_PERMISSION"
:
"see_in_catalog"
,
"COURSE_ABOUT_VISIBILITY_PERMISSION"
:
"see_about_page"
,
"ENABLE_SHOPPING_CART"
:
True
,
"ENABLE_PAID_COURSE_REGISTRATION"
:
True
,
"SESSION_COOKIE_DOMAIN"
:
"test_logistration.localhost"
,
},
"default"
:
{
"default"
:
{
"university"
:
"default_university"
,
"university"
:
"default_university"
,
"domain_prefix"
:
"www"
,
"domain_prefix"
:
"www"
,
...
@@ -422,6 +447,7 @@ MICROSITE_CONFIGURATION = {
...
@@ -422,6 +447,7 @@ MICROSITE_CONFIGURATION = {
}
}
MICROSITE_ROOT_DIR
=
COMMON_ROOT
/
'test'
/
'test_microsites'
MICROSITE_ROOT_DIR
=
COMMON_ROOT
/
'test'
/
'test_microsites'
MICROSITE_TEST_HOSTNAME
=
'testmicrosite.testserver'
MICROSITE_TEST_HOSTNAME
=
'testmicrosite.testserver'
MICROSITE_LOGISTRATION_HOSTNAME
=
'logistration.testserver'
FEATURES
[
'USE_MICROSITES'
]
=
True
FEATURES
[
'USE_MICROSITES'
]
=
True
...
...
lms/lib/courseware_search/test/test_lms_filter_generator.py
View file @
848e72c7
...
@@ -102,12 +102,16 @@ class LmsSearchFilterGeneratorTestCase(ModuleStoreTestCase):
...
@@ -102,12 +102,16 @@ class LmsSearchFilterGeneratorTestCase(ModuleStoreTestCase):
self
.
assertEqual
(
0
,
len
(
field_dictionary
[
'course'
]))
self
.
assertEqual
(
0
,
len
(
field_dictionary
[
'course'
]))
def
test_excludes_microsite
(
self
):
def
test_excludes_microsite
(
self
):
""" By default there is the test microsite to exclude """
"""
By default there is the test microsite and the microsite with logistration
to exclude
"""
_
,
_
,
exclude_dictionary
=
LmsSearchFilterGenerator
.
generate_field_filters
(
user
=
self
.
user
)
_
,
_
,
exclude_dictionary
=
LmsSearchFilterGenerator
.
generate_field_filters
(
user
=
self
.
user
)
self
.
assertIn
(
'org'
,
exclude_dictionary
)
self
.
assertIn
(
'org'
,
exclude_dictionary
)
exclude_orgs
=
exclude_dictionary
[
'org'
]
exclude_orgs
=
exclude_dictionary
[
'org'
]
self
.
assertEqual
(
1
,
len
(
exclude_orgs
))
self
.
assertEqual
(
2
,
len
(
exclude_orgs
))
self
.
assertEqual
(
'TestMicrositeX'
,
exclude_orgs
[
0
])
self
.
assertEqual
(
'LogistrationX'
,
exclude_orgs
[
0
])
self
.
assertEqual
(
'TestMicrositeX'
,
exclude_orgs
[
1
])
@patch
(
'microsite_configuration.microsite.get_all_orgs'
,
Mock
(
return_value
=
[]))
@patch
(
'microsite_configuration.microsite.get_all_orgs'
,
Mock
(
return_value
=
[]))
def
test_excludes_no_microsite
(
self
):
def
test_excludes_no_microsite
(
self
):
...
...
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