Skip to content
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 5 commits into from
Jul 7, 2017

Conversation

runderwood
Copy link
Collaborator

Refs. #84 #85

Branch name is result of insufficient memory.

@ldko @somexpert

@@ -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)
Copy link
Member

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?

@somexpert
Copy link
Member

👍 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
Copy link
Member

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?

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),
Copy link
Member

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?

Copy link
Collaborator Author

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.

@ldko
Copy link
Member

ldko commented Jul 7, 2017

👍

@runderwood runderwood merged commit de735f9 into master Jul 7, 2017
@runderwood runderwood deleted the 86-idlen branch July 7, 2017 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants