/ Published in: Django
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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 ...\'
URL: http://docs.djangoproject.com/en/1.1/topics/testing/