Add tests for middleware.
Small refactoring of imports in tests.
Add tests for middleware.get_draft_status().