Web???????????
???????????? ???????[ 2016/3/1 11:32:05 ] ??????????????? ??????
????1?????????????
????2?????????????????????
????……
????????????????????????????????????????????????????????????????????ε?????Щ????????????
????????????
?????????д?????????????????漰???????????????????й????????unittest??????????request??
import unittest
import requests
class PollsTest(unittest.TestCase):
def setUp(self):
self.base_url = 'http://127.0.0.1:8000/polls'
def tearDown(self):
pass
def test_get_poll_index(self):
'''???????????'''
r = requests.get(self.base_url)
code = r.status_code
text = r.text
self.assertEqual(code?? 200)
def test_get_poll_question(self):
'''???????1?????????'''
r = requests.get(self.base_url+'/1/')
code = r.status_code
text = r.text
self.assertEqual(code?? 200)
self.assertIn("3"??text)
if __name__ == '__main__':
unittest.main()
????????????????????д???????????????y??????????????????????????????????????ɡ?
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11