-
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
Conversation
tests/test_views.py
Outdated
@@ -786,7 +786,7 @@ def test_results_per_page(self, rf): | |||
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']) == min(self.RESULTS_PER_PAGE, 30) |
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.
Should we split this into maybe two tests? One with less than 200 events created and one with more? It seems to me that this test was originally designed to create more events than could be seen on a single page, and thus show that only the amount per page was shown, rather than all the events. There are other tests that essentially show what we want, but if we're going for really explicit tests, maybe it's worth it?
👍 regardless of what happens with above suggestion |
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
Here you are using EVENT_SEARCH_PER_PAGE
, in app_event
you hard code 200. Do we want to switch in one place or the other?
premis_event_service/views.py
Outdated
if request.GET: | ||
page = int(request.GET['page']) if request.GET.get('page') else 1 | ||
else: | ||
page = 1 | ||
try: | ||
atomFeed = makeObjectFeed( | ||
paginator=Paginator(events, 20), | ||
paginator=Paginator(events, 200), |
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 the 20
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.
👍 |
Refs. #84 #85
Branch name is result of insufficient memory.
@ldko @somexpert