'Ensure POSTing json over basic auth without correct credentials fails'

def test_post_json_failing_basic_auth(self):

    response = self.csrf_client.post(u'/basic/', {u'example': u'example'}, format=u'json')
    assert (response.status_code == status.HTTP_401_UNAUTHORIZED)
    assert (response[u'WWW-Authenticate'] == u'Basic    realm="api"')
