-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow for longer linked object IDs, increase page size for event listings #88
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
4ffcc35
closes #84 raises max_length for linked obj id in forms, refs #85 rai…
601fb6a
make atompub event listing page size consistent w/ other listings
9e774df
remove unused variables, update test for atompub listing
213bf9f
more explicit search results test
f0fb31b
use constant
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -402,7 +402,7 @@ def test_head_and_get_headers_match_with_identifier(self, rf): | |
class TestAppEvent: | ||
"""Tests for views.app_event.""" | ||
CONTENT_TYPE = 'application/atom+xml' | ||
RESULTS_PER_PAGE = 20 | ||
RESULTS_PER_PAGE = views.EVENT_SEARCH_PER_PAGE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here you are using |
||
|
||
def response_has_event(self, response, event): | ||
"""True if the event is the only event in the response content.""" | ||
|
@@ -682,7 +682,7 @@ def test_head_and_get_headers_match_with_identifier(self, rf): | |
|
||
class TestEventSearch: | ||
"""Tests for views.event_search.""" | ||
RESULTS_PER_PAGE = 20 | ||
RESULTS_PER_PAGE = views.EVENT_SEARCH_PER_PAGE | ||
|
||
def response_has_event(self, response, event): | ||
"""True if the event is the only Event in the response context.""" | ||
|
@@ -734,7 +734,7 @@ def test_filtering_results(self, client): | |
|
||
class TestJsonEventSearch: | ||
"""Tests for views.json_event_search.""" | ||
RESULTS_PER_PAGE = 20 | ||
RESULTS_PER_PAGE = views.EVENT_SEARCH_PER_PAGE | ||
CONTENT_TYPE = 'application/json' | ||
REL_SELF = 'self' | ||
REL_FIRST = 'first' | ||
|
@@ -782,11 +782,12 @@ def test_no_results(self, rf): | |
assert response.status_code == 200 | ||
|
||
def test_results_per_page(self, rf): | ||
factories.EventFactory.create_batch(30) | ||
per_page = self.RESULTS_PER_PAGE | ||
factories.EventFactory.create_batch(per_page*4) | ||
request = rf.get('/') | ||
response = views.json_event_search(request) | ||
data = json.loads(response.content) | ||
assert len(data['feed']['entry']) == self.RESULTS_PER_PAGE | ||
assert len(data['feed']['entry']) == per_page | ||
|
||
def test_opensearch_query(self, rf): | ||
factories.EventFactory.create_batch(10) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this
200
since the20
was hard coded or do you want to use the constant?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, sorry. It's a mistake. I hard-coded it to make sure the paginator still worked properly, intending to either change it or set it to a new constant w/ the same value. Fix coming momentarily.