1030905 more api tests

Add api tests for filtering by date.
Also edited code for pep8 compliance for quality.
I'm finding it hard to bounce around the code verifying that the tests are correct and that the outcomes of the test are clear and unambiguous.

With regular code, I tend to do what you've done here: extract the duplicated code into a function. With test code, I tend not to do that because it makes tests harder to read and harder-to-read tests tend to be more likely to be incorrect.

In order to verify this test is correct, I need to know the created times for the available responses as well as the expected created times. Having those two pieces of information together rather than in different places would make this easier to verify today as well as in the future. This is one of the big reasons I dislike fixtures, too.