def test_from_post_request(self): factory = RequestFactory() post_request = factory.post('/', data=REPLACE_RESULT_XML, content_type='application/xml') request = OutcomeRequest.from_post_request(post_request) self.assertEqual(request.operation, 'replaceResult') self.assertEqual(request.lis_result_sourcedid, '261-154-728-17-784') self.assertEqual(request.message_identifier, '123456789') self.assertEqual(request.score, '5')
def test_from_post_request(self): factory = RequestFactory() post_request = factory.post('/', data=REPLACE_RESULT_XML, content_type='application/xml' ) request = OutcomeRequest.from_post_request(post_request) self.assertEqual(request.operation, 'replaceResult') self.assertEqual(request.lis_result_sourcedid, '261-154-728-17-784') self.assertEqual(request.message_identifier, '123456789') self.assertEqual(request.score, '5')
def test_from_post_request(self): factory = RequestFactory() post_request = factory.post('/', data=REPLACE_RESULT_XML, content_type='application/xml') request_headers = { "User-Agent": "post-request", "Content-Type": "text/xml" } request = OutcomeRequest.from_post_request(post_request, request_headers) self.assertEqual(request.operation, 'replaceResult') self.assertEqual(request.lis_result_sourcedid, '261-154-728-17-784') self.assertEqual(request.message_identifier, '123456789') self.assertEqual(request.score, '5') self.assertEqual(request.headers.get('User-Agent'), "post-request") self.assertEqual(request.headers.get('Content-Type'), "text/xml")