Posted By

magicrebirth on 05/17/10


Tagged

test testing django


Versions (?)

Django | Testing Django applications


 / Published in: Django
 

URL: http://docs.djangoproject.com/en/1.1/topics/testing/

  1. from django.test.client import Client
  2. c = Client()
  3. response = c.post(\'/login/\', {\'username\': \'john\', \'password\': \'smith\'})
  4. response.status_code
  5. # 200
  6. response = c.get(\'/customer/details/\')
  7. response.content
  8. # \'<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 ...\'

Report this snippet  

You need to login to post a comment.