Example #1
0
	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)
Example #2
0
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)
Example #3
0
 def test_returns_appropriate_contact_html_response_code(self):
     resp=contact(self.request)
     self.assertEquals(resp.status_code,200)