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
Add API endpoints for adding, removing and updating talk URLs #316
Conversation
|
Ready for review. |
| talk_a = create_talk("Talk A", ACCEPTED, "author_a") | ||
| talk_b = create_talk("Talk B", REJECTED, "author_b") | ||
| response = self.client.get('/talks/api/talks/') | ||
| result_0, result_1 = response.data['results'] |
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.
Why are we splitting this if we're then testing response.data['results'] directly?
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.
I've removed these unused variables. :)
| url_b = TalkUrl.objects.create( | ||
| talk=talk, url="http://b.example.com/", description="slides") | ||
| response = self.client.get('/talks/api/talks/%d/urls/' % talk.talk_id) | ||
| result_0, result_1 = response.data['results'] |
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.
Same question as before
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.
And these ones.
|
|
||
| def generic(self, *args, **kw): | ||
| response = super(SortedResultsClient, self).generic(*args, **kw) | ||
| return self._sorted_response(response) | ||
|
|
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.
This isn't terrible specific to talks - should we move it to a test_utils module so it can be used when testing other apis?
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.
I moved it into wafer.tests.api_utils. It'll likely need to grow some features once we start writing tests for other parts of the API.
This adds the following API end points:
/talks/api/talks/<talk_id>/urls//talks/api/talks/<talk_id>/urls/<url_id>/If also adds a summary of the URLs to the data returned when querying the talks API.