def test_post(self): headers = {'Authorization': '930b5250fb9e23c32e8b9357d8334aa3e373ff7a'} json_content = {'content': 'this is the first f**k'} response = requests.post(self.test_url, headers=headers, data=json.dumps(json_content)) self.assertEqual(response.status_code, 200) self.assertEqual(response.json()['content'], 'this is the first f**k')
def test_post(self): headers = {'Authorization': '930b5250fb9e23c32e8b9357d8334aa3e373ff7a'} json_content = {'name': 'f*****g girl', 'description': 'f*****g girl'} response = requests.post(self.test_url, data=json.dumps(json_content), headers=headers) self.assertEqual(response.status_code, 200) self.assertEqual(response.json()['name'], 'f*****g girl')
def test_post(self): headers = {'authorization': '930b5250fb9e23c32e8b9357d8334aa3e373ff7a'} json_content = {'member_id': 2} response = requests.post(self.test_url, headers=headers, data=json.dumps(json_content)) self.assertEqual(response.status_code, 200) self.assertEqual(response.json()['member_id'], 2) self.assertEqual(response.json()['status'], 1)
def test_post(self): json_content = {'cell_phone': 13667148902, 'password': '******'} response = requests.post(self.test_url, data=json.dumps(json_content)) self.assertEqual(response.status_code, 200) self.assertIn('access_token', response.json().keys()) self.assertIn('url', response.json().keys())
def test_post(self): json_content = {'user_id': 1, 'content': 'hehe'} response = requests.post(self.test_url, data=json.dumps(json_content)) self.assertEqual(response.status_code, 200) self.assertEqual(response.json()['content'], 'hehe')
def test_post(self): json_content = {'cell_phone': 13667148901, 'password': '******'} response = requests.post(self.test_url, data=json.dumps(json_content)) self.assertEqual(response.status_code, 200)