django test基本操做

在tests.py中,导入TestCase包 from django.test import TestCase 建立测试类: class SimpleTest(TestCase): 建立测试函数,必须以test_开头 def test_login(self): 模拟客户端发送数据 c=Client(HTTP_USER_AGENT='Mozilla/5.0') response=c.post('/
相关文章
相关标签/搜索