Cleaned tests file to correct all pyflakes and pep8 errors

I'd prefer doing:

```
client.post(view, {
    key: value})
```

or

```
client.post(view, {
    key:
    value})
```

but that's purely stylistic, I would accept it either way.