Made manufacturer part ID dynamic for API supplier part create test

This commit is contained in:
eeintech 2021-04-06 14:53:35 -04:00
parent 52b2b9582d
commit 734985faa9

View File

@ -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')