mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Made manufacturer part ID dynamic for API supplier part create test
This commit is contained in:
parent
52b2b9582d
commit
734985faa9
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user