'The test client can enforce CSRF checks.'

def test_explicitly_enforce_csrf_checks(self):

    client = APIClient(enforce_csrf_checks=True)
    User.objects.create_user(u'example', u'example@example.com', u'password')
    client.login(username=u'example', password=u'password')
    response = client.post(u'/view/')
    expected = {u'detail': u'CSRF    Failed:    CSRF    cookie    not    set.'}
    assert (response.status_code == 403)
    assert (response.data == expected)
