Refactor tests to use WebTestCase instead of ClientTestsCase

ClientTestCase is deprecated.

Fixes #826
Fixes #1007
Refactor report date filtering

PEP8 warnings needed fixing anyway, so I've simplified the logic
slightly.