from django.test import TestCase, Client class ViewsTestCase(TestCase): def setUp(self): self.client = Client() def test_root(self): response = self.client.get('/', follow=False) self.assertIn('root_urls', response.context, '\'root_urls\' not in context of root view')