Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-notes-api
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-notes-api
Commits
4cc2dffd
Commit
4cc2dffd
authored
Jan 09, 2015
by
Tim Babych
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not call update_index in tests
parent
c87dde93
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
9 deletions
+2
-9
notesapi/v1/tests/test_views.py
+0
-7
notesserver/settings/common.py
+1
-1
notesserver/settings/yaml_config.py
+1
-1
No files found.
notesapi/v1/tests/test_views.py
View file @
4cc2dffd
...
...
@@ -31,7 +31,6 @@ class BaseAnnotationViewTests(APITestCase):
"""
def
setUp
(
self
):
call_command
(
'clear_index'
,
interactive
=
False
)
call_command
(
'update_index'
)
token
=
get_id_token
(
TEST_USER
)
self
.
client
.
credentials
(
HTTP_X_ANNOTATOR_AUTH_TOKEN
=
token
)
...
...
@@ -62,14 +61,12 @@ class BaseAnnotationViewTests(APITestCase):
url
=
reverse
(
'api:v1:annotations'
)
response
=
self
.
client
.
post
(
url
,
opts
,
format
=
'json'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_201_CREATED
)
call_command
(
'update_index'
)
return
response
.
data
.
copy
()
def
_get_annotation
(
self
,
annotation_id
):
"""
Fetch annotation
"""
call_command
(
'update_index'
)
url
=
reverse
(
'api:v1:annotations_detail'
,
kwargs
=
{
'annotation_id'
:
annotation_id
})
response
=
self
.
client
.
get
(
url
,
self
.
headers
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_200_OK
)
...
...
@@ -268,7 +265,6 @@ class AnnotationDetailViewTests(BaseAnnotationViewTests):
payload
.
update
(
self
.
headers
)
url
=
reverse
(
'api:v1:annotations_detail'
,
kwargs
=
{
'annotation_id'
:
data
[
'id'
]})
response
=
self
.
client
.
put
(
url
,
payload
,
format
=
'json'
)
call_command
(
'update_index'
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_200_OK
)
annotation
=
self
.
_get_annotation
(
data
[
'id'
])
...
...
@@ -341,8 +337,6 @@ class AnnotationDetailViewTests(BaseAnnotationViewTests):
response
=
self
.
client
.
delete
(
url
,
self
.
headers
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_204_NO_CONTENT
,
"response should be 204 NO CONTENT"
)
call_command
(
'update_index'
)
url
=
reverse
(
'api:v1:annotations_detail'
,
kwargs
=
{
'annotation_id'
:
note
[
'id'
]})
response
=
self
.
client
.
get
(
url
,
self
.
headers
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_404_NOT_FOUND
)
...
...
@@ -429,7 +423,6 @@ class AnnotationSearchlViewTests(BaseAnnotationViewTests):
payload
.
update
(
self
.
headers
)
url
=
reverse
(
'api:v1:annotations_detail'
,
kwargs
=
{
'annotation_id'
:
note
[
'id'
]})
response
=
self
.
client
.
put
(
url
,
payload
,
format
=
'json'
)
call_command
(
'update_index'
)
results
=
self
.
_get_search_results
()
self
.
assertEqual
(
results
[
'rows'
][
0
][
'text'
],
'Updated Second Note'
)
...
...
notesserver/settings/common.py
View file @
4cc2dffd
...
...
@@ -12,7 +12,7 @@ TIME_ZONE = 'UTC'
# This value needs to be overriden in production.
SECRET_KEY
=
'*^owi*4
%
!
%9
=#h@app!l^$jz8(c*q297^)4&4yn^#_m#fq=z#l'
ALLOWED_HOSTS
=
[
'localhost'
,
'*.edx.org'
]
ALLOWED_HOSTS
=
[
'localhost'
,
'*.edx.org'
]
# ID and Secret used for authenticating JWT Auth Tokens
# should match those configured for `edx-notes` Client in EdX's /admin/oauth2/client/
...
...
notesserver/settings/yaml_config.py
View file @
4cc2dffd
...
...
@@ -16,7 +16,7 @@ EDXNOTES_CONFIG_ROOT = os.environ.get('EDXNOTES_CONFIG_ROOT')
if
not
EDXNOTES_CONFIG_ROOT
:
raise
ImproperlyConfigured
(
"EDXNOTES_CONFIG_ROOT must be defined in the environment."
)
CONFIG_ROOT
=
path
(
EDXNOTES_CONFIG_ROOT
)
with
open
(
CONFIG_ROOT
/
"edx-notes-api.yml"
)
as
yaml_file
:
...
...
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