handle external url redirect in unit test
@@ -55,9 +55,10 @@ class TestPublicZipEndpoint(HSRESTTestCase):
def test_folder_download_rest(self):
date_folder = (date.today()).strftime('%Y-%m-%d')
- zip_download_url = "/hsapi/resource/{pid}/data/contents/foo".format(pid=self.pid)
+ zip_download_url = "/resource/{pid}/data/contents/foo".format(pid=self.pid)
response = self.client.get(zip_download_url, format="json")
- self.assertEqual(response.status_code, status.HTTP_200_OK)
+ # becasue of the redirect to the internal url, the status code is 301
+ self.assertEqual(response.status_code, status.HTTP_301_MOVED_PERMANENTLY)
response_json = json.loads(response.content)
task_id = response_json["task_id"]
download_path = response_json["download_path"]
