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
ae383066
Commit
ae383066
authored
Dec 29, 2014
by
Tim Babych
Committed by
Oleg Marshev
Jan 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add course test
parent
243876c5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
notesapi/v1/tests/test_views.py
+20
-3
No files found.
notesapi/v1/tests/test_views.py
View file @
ae383066
...
...
@@ -322,9 +322,9 @@ class AnnotationViewTests(BaseAnnotationViewTests):
Sorting is by descending order (most recent first).
"""
note_1
=
self
.
_create_annotation
(
text
=
u'First one'
)
note_2
=
self
.
_create_annotation
(
text
=
u'Second note'
)
note_3
=
self
.
_create_annotation
(
text
=
u'Third note'
)
self
.
_create_annotation
(
text
=
u'First one'
)
self
.
_create_annotation
(
text
=
u'Second note'
)
self
.
_create_annotation
(
text
=
u'Third note'
)
results
=
self
.
_get_search_results
()
self
.
assertEqual
(
results
[
'rows'
][
0
][
'text'
],
'Third note'
)
...
...
@@ -339,9 +339,26 @@ class AnnotationViewTests(BaseAnnotationViewTests):
results
=
self
.
_get_search_results
(
text
=
u"веселих"
)
self
.
assertEqual
(
results
[
'total'
],
1
)
self
.
assertEqual
(
results
[
'rows'
][
0
][
'text'
],
u'Веселих свят'
)
results
=
self
.
_get_search_results
(
text
=
u"Свят"
)
self
.
assertEqual
(
results
[
'rows'
][
0
][
'text'
],
u'Веселих свят'
)
def
test_search_course
(
self
):
"""
Tests searching with course_id provided
"""
self
.
_create_annotation
(
text
=
u'First one'
,
course_id
=
"a"
)
self
.
_create_annotation
(
text
=
u'Second note'
,
course_id
=
"a"
)
self
.
_create_annotation
(
text
=
u'Third note'
,
course_id
=
"b"
)
self
.
_create_annotation
(
text
=
u'Fourth note'
,
course_id
=
"c"
)
results
=
self
.
_get_search_results
(
course_id
=
"a"
)
self
.
assertEqual
(
results
[
'total'
],
2
)
results
=
self
.
_get_search_results
(
course_id
=
"b"
)
self
.
assertEqual
(
results
[
'total'
],
1
)
self
.
assertEqual
(
results
[
'rows'
][
0
][
'text'
],
u'Third note'
)
def
test_read_all_no_annotations
(
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