class TestResponse(TestCase): def setUp(self): self.request_mock = mock.MagicMock() self.response = Response(request=self.request_mock) def test_location_header(self): self.request_mock.url = 'http://testurl/api' self.response.location_header(10) self.assertEqual(self.response.headers['Location'], 'http://testurl/api/10') def test_get_response_data_raises_error(self): self.assertRaises(NotImplementedError, self.response.get_response_data)
def setUp(self): self.request_mock = mock.MagicMock() self.response = Response(request=self.request_mock)