def test_html_rendering(self): request= RequestFactory().get('/contact/') tested_html= views.contact(request).content expected_html = render_to_response('contact/contact.html').content self.assertEquals = (expected_html,tested_html)
def home(request): post_list = Post.objects.all() context = { 'post_list': post_list, 'form': views.contact(request=request), } template = "base.html" return render(request, template, context)
def test_returns_appropriate_contact_html_response_code(self): resp=contact(self.request) self.assertEquals(resp.status_code,200)