Tests: set content type via kw argument instead of header
Minor test refactoring