def test_no_logged_in_user(self): mock_request = rf.get('/api/position/select/all') response = position_select_all(mock_request) self.assertTrue('"error_id": 300' in response.content.decode('utf-8'))
def test_objects_retrieved(self): response = position_select_all(self.request) json_obj = json.loads(response.content.decode('utf-8')) self.assertEqual(2, len(json_obj['data']))
def test_wrong_request_type(self): mock_request = rf.post('/api/position/select/all?session_id=' + str(self.session_id)) response = position_select_all(mock_request) self.assertTrue('"error_id": 301' in response.content.decode('utf-8'))
def test_success_status(self): response = position_select_all(self.request) self.assertTrue( '"status": "success"' in response.content.decode('utf-8'))