comparison examples/project/tests/test_views.py @ 8:a82369f2574e

http client tests
author Victor Ng <victor@monkeybean.ca>
date Thu, 28 Aug 2008 12:42:31 -0400
parents ff263bdd455e
children
comparison
equal deleted inserted replaced
7:dfba3a3a4343 8:a82369f2574e
1 from django.http import HttpRequest 1 from django.test.client import Client
2 from project.zoo import views
3 2
4 def test_view_index(): 3 def test_view_index():
5 r = views.index(HttpRequest()) 4 c = Client()
6 assert r 5 resp = c.get('/zoo/')
6 assert "Just a title" in resp.content
7 assert "foobar" in resp.content