Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
code.vt.edu will be down for maintenance from 0530-0630 EDT Wednesday, March 26th
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
0c7ad643
Commit
0c7ad643
authored
5 years ago
by
Diana Huang
Browse files
Options
Downloads
Patches
Plain Diff
Clean up theming tests and microsites.
parent
6604cf10
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
openedx/core/djangoapps/theming/helpers.py
+0
-8
0 additions, 8 deletions
openedx/core/djangoapps/theming/helpers.py
openedx/core/djangoapps/theming/tests/test_helpers.py
+8
-20
8 additions, 20 deletions
openedx/core/djangoapps/theming/tests/test_helpers.py
with
8 additions
and
28 deletions
openedx/core/djangoapps/theming/helpers.py
+
0
−
8
View file @
0c7ad643
...
...
@@ -40,14 +40,6 @@ def is_request_in_themed_site():
return
configuration_helpers
.
is_site_configuration_enabled
()
def
get_template
(
uri
):
"""
This is a proxy function to hide microsite_configuration behind comprehensive theming.
:param uri: uri of the template
"""
return
None
def
get_template_path_with_theme
(
relative_path
):
"""
Returns template path in current site
'
s theme if it finds one there otherwise returns same path.
...
...
This diff is collapsed.
Click to expand it.
openedx/core/djangoapps/theming/tests/test_helpers.py
+
8
−
20
View file @
0c7ad643
...
...
@@ -68,27 +68,23 @@ class TestHelpers(TestCase):
Tests to make sure the is_comprehensive_theming_enabled function works as expected.
Here are different scenarios that we need to test
1. Theming is enabled
,
there is a SiteTheme record
and microsite configuration for the current site
.
1. Theming is enabled
and
there is a SiteTheme record.
is_comprehensive_theming_enabled should return True
2. Theming is enabled
,
there is no SiteTheme record
but there is microsite configuration for the current site
.
2. Theming is enabled
and
there is no SiteTheme record.
is_comprehensive_theming_enabled should return False
3. Theming is enabled, there is neither a SiteTheme record nor microsite configuration for the current site.
is_comprehensive_theming_enabled should return True
4. Theming is disabled, there is a SiteTheme record and microsite configuration for the current site.
is_comprehensive_theming_enabled should return False
5. Theming is disabled, there is no SiteTheme record but there is microsite configuration for the current site.
3. Theming is disabled, there is a SiteTheme record for the current site.
is_comprehensive_theming_enabled should return False
6
. Theming is disabled, there is n
either a
SiteTheme record
nor microsite configuration for the current site
.
4
. Theming is disabled, there is n
o
SiteTheme record.
is_comprehensive_theming_enabled should return False
"""
# Theming is enabled, there is a SiteTheme record
and microsite configuration for the current site
# Theming is enabled, there is a SiteTheme record
with
patch
(
"
openedx.core.djangoapps.theming.helpers.current_request_has_associated_site_theme
"
,
Mock
(
return_value
=
True
),
):
self
.
assertTrue
(
theming_helpers
.
is_comprehensive_theming_enabled
())
# Theming is enabled, there is n
either
a SiteTheme record
nor microsite configuration for the current site.
# Theming is enabled, there is n
ot
a SiteTheme record
with
patch
(
"
openedx.core.djangoapps.theming.helpers.current_request_has_associated_site_theme
"
,
Mock
(
return_value
=
False
),
...
...
@@ -96,22 +92,14 @@ class TestHelpers(TestCase):
self
.
assertTrue
(
theming_helpers
.
is_comprehensive_theming_enabled
())
with
override_settings
(
ENABLE_COMPREHENSIVE_THEMING
=
False
):
# Theming is disabled, there is a SiteTheme record
and microsite configuration for the current site.
# Theming is disabled, there is a SiteTheme record
with
patch
(
"
openedx.core.djangoapps.theming.helpers.current_request_has_associated_site_theme
"
,
Mock
(
return_value
=
True
),
):
self
.
assertFalse
(
theming_helpers
.
is_comprehensive_theming_enabled
())
# Theming is disabled, there is no SiteTheme record but
# there is microsite configuration for the current site.
with
patch
(
"
openedx.core.djangoapps.theming.helpers.current_request_has_associated_site_theme
"
,
Mock
(
return_value
=
False
),
):
self
.
assertFalse
(
theming_helpers
.
is_comprehensive_theming_enabled
())
# Theming is disabled, there is neither a SiteTheme record nor microsite configuration for the current site.
# Theming is disabled, there is no SiteTheme record
with
patch
(
"
openedx.core.djangoapps.theming.helpers.current_request_has_associated_site_theme
"
,
Mock
(
return_value
=
False
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment