Skip to content

Instantly share code, notes, and snippets.

@lambdamusic
Created February 7, 2013 21:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lambdamusic/4734318 to your computer and use it in GitHub Desktop.
Save lambdamusic/4734318 to your computer and use it in GitHub Desktop.
Django: Django | Testing Django applications
from django.test.client import Client
c = Client()
response = c.post(\'/login/\', {\'username\': \'john\', \'password\': \'smith\'})
response.status_code
# 200
response = c.get(\'/customer/details/\')
response.content
# \'<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 ...\'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment