improve tests
refactor tests for csrf middleware