'The 404 page should have the csrf_token available in the context'

@override_settings(TEMPLATES=[{'BACKEND': 'django.template.backends.django.DjangoTemplates', 'OPTIONS': {'loaders': [('django.template.loaders.locmem.Loader', {'404.html': '{{    csrf_token    }}'})]}}])
def test_csrf_token_in_404(self):

    for url in self.nonexistent_urls:
        response = self.client.get(url)
        self.assertNotEqual(response.content, 'NOTPROVIDED')
        self.assertNotEqual(response.content, '')
