Fix parameter name in urls.py
Requesting logfiles did not work because of a misalignment of the
parameter names in urls.py and rest_endpoint.py.
Issue: HIC-191
Change-Id: I6e2806357069009802eab13a0eece94d12f05b97
diff --git a/crashreport_stats/tests.py b/crashreport_stats/tests.py
index 39a094f..e9a3734 100644
--- a/crashreport_stats/tests.py
+++ b/crashreport_stats/tests.py
@@ -1596,7 +1596,6 @@
# Assert that the statistics match
self.assertEqual(expected_update_history, response.data)
- @unittest.skip("Fails because of bug in urls.py")
def test_download_non_existing_logfile(self):
"""Test download of a non existing log file."""
# Try to get a log file
@@ -1607,7 +1606,6 @@
# Assert that the log file was not found
self.assertEqual(response.status_code, status.HTTP_404_NOT_FOUND)
- @unittest.skip("Fails because of bug in urls.py")
def test_download_logfile(self):
"""Test download of log files."""
# Create a device with a crash report along with log file
diff --git a/crashreport_stats/urls.py b/crashreport_stats/urls.py
index 04b008f..115fcf3 100644
--- a/crashreport_stats/urls.py
+++ b/crashreport_stats/urls.py
@@ -34,7 +34,7 @@
name="hiccup_stats_api_v1_device_report_history",
),
url(
- r"^api/v1/logfile_download/(?P<id>[0-9]+)/$",
+ r"^api/v1/logfile_download/(?P<id_logfile>[0-9]+)/$",
rest_endpoints.LogFileDownload.as_view(),
name="hiccup_stats_api_v1_logfile_download",
),