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
040f5cc9
Commit
040f5cc9
authored
Sep 20, 2017
by
John Eskew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move edxnotes model import down into method.
parent
7dfb6cc6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
lms/djangoapps/edxnotes/decorators.py
+2
-1
lms/djangoapps/edxnotes/tests.py
+4
-4
No files found.
lms/djangoapps/edxnotes/decorators.py
View file @
040f5cc9
...
...
@@ -7,7 +7,6 @@ import json
from
django.conf
import
settings
from
edxmako.shortcuts
import
render_to_string
from
edxnotes.helpers
import
generate_uid
,
get_edxnotes_id_token
,
get_public_endpoint
,
get_token_url
,
is_feature_enabled
def
edxnotes
(
cls
):
...
...
@@ -20,6 +19,8 @@ def edxnotes(cls):
"""
Returns raw html for the component.
"""
# Import is placed here to avoid model import at project startup.
from
edxnotes.helpers
import
generate_uid
,
get_edxnotes_id_token
,
get_public_endpoint
,
get_token_url
,
is_feature_enabled
is_studio
=
getattr
(
self
.
system
,
"is_author_mode"
,
False
)
course
=
self
.
descriptor
.
runtime
.
modulestore
.
get_course
(
self
.
runtime
.
course_id
)
...
...
lms/djangoapps/edxnotes/tests.py
View file @
040f5cc9
...
...
@@ -106,10 +106,10 @@ class EdxNotesDecoratorTest(ModuleStoreTestCase):
self
.
problem
=
TestProblem
(
self
.
course
)
@patch.dict
(
"django.conf.settings.FEATURES"
,
{
'ENABLE_EDXNOTES'
:
True
})
@patch
(
"edxnotes.
decorato
rs.get_public_endpoint"
,
autospec
=
True
)
@patch
(
"edxnotes.
decorato
rs.get_token_url"
,
autospec
=
True
)
@patch
(
"edxnotes.
decorato
rs.get_edxnotes_id_token"
,
autospec
=
True
)
@patch
(
"edxnotes.
decorato
rs.generate_uid"
,
autospec
=
True
)
@patch
(
"edxnotes.
helpe
rs.get_public_endpoint"
,
autospec
=
True
)
@patch
(
"edxnotes.
helpe
rs.get_token_url"
,
autospec
=
True
)
@patch
(
"edxnotes.
helpe
rs.get_edxnotes_id_token"
,
autospec
=
True
)
@patch
(
"edxnotes.
helpe
rs.generate_uid"
,
autospec
=
True
)
def
test_edxnotes_enabled
(
self
,
mock_generate_uid
,
mock_get_id_token
,
mock_get_token_url
,
mock_get_endpoint
):
"""
Tests if get_html is wrapped when feature flag is on and edxnotes are
...
...
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