from django.conf.urls import patterns, url from guestbook.views import GuestbookListView urlpatterns = patterns('', url(r'^$', GuestbookListView.as_view(), name='guestbook_list'), )
def test_adds_form_to_context(self): request = RequestFactory().get(reverse("guestbook_list")) view = GuestbookListView.as_view() resp = view(request) self.assertTrue("form" in resp.context_data)