diff --git a/InvenTree/company/test_api.py b/InvenTree/company/test_api.py index ef93a3c442..a65beb4dc2 100644 --- a/InvenTree/company/test_api.py +++ b/InvenTree/company/test_api.py @@ -111,7 +111,7 @@ class ManufacturerTest(InvenTreeAPITestCase): def test_manufacturer_part_detail(self): url = reverse('api-manufacturer-part-detail', kwargs={'pk': 1}) - + response = self.get(url) self.assertEqual(response.data['MPN'], 'MPN123') @@ -145,6 +145,7 @@ class ManufacturerTest(InvenTreeAPITestCase): self.assertEqual(response.status_code, status.HTTP_201_CREATED) # Check manufacturer part - url = reverse('api-manufacturer-part-detail', kwargs={'pk': 5}) + manufacturer_part_id = int(response.data['manufacturer_part']['pk']) + url = reverse('api-manufacturer-part-detail', kwargs={'pk': manufacturer_part_id}) response = self.get(url) self.assertEqual(response.data['MPN'], 'PART_NUMBER')