mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 12:06:44 +00:00
parent
e6461929b0
commit
5263ccdca3
@ -217,6 +217,7 @@ class ManufacturerTest(InvenTreeAPITestCase):
|
|||||||
'part': 1,
|
'part': 1,
|
||||||
'manufacturer': 7,
|
'manufacturer': 7,
|
||||||
'MPN': 'PART_NUMBER',
|
'MPN': 'PART_NUMBER',
|
||||||
|
'link': 'https://www.axel-larsson.se/Exego.aspx?p_id=341&ArtNr=0804020E',
|
||||||
},
|
},
|
||||||
expected_code=201
|
expected_code=201
|
||||||
)
|
)
|
||||||
@ -229,17 +230,24 @@ class ManufacturerTest(InvenTreeAPITestCase):
|
|||||||
'supplier': 1,
|
'supplier': 1,
|
||||||
'SKU': 'SKU_TEST',
|
'SKU': 'SKU_TEST',
|
||||||
'manufacturer_part': pk,
|
'manufacturer_part': pk,
|
||||||
|
'link': 'https://www.axel-larsson.se/Exego.aspx?p_id=341&ArtNr=0804020E',
|
||||||
}
|
}
|
||||||
|
|
||||||
response = self.client.post(url, data, format='json')
|
response = self.client.post(url, data, format='json')
|
||||||
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
||||||
|
|
||||||
|
# Check link is not modified
|
||||||
|
self.assertEqual(response.data['link'], 'https://www.axel-larsson.se/Exego.aspx?p_id=341&ArtNr=0804020E')
|
||||||
|
|
||||||
# Check manufacturer part
|
# Check manufacturer part
|
||||||
manufacturer_part_id = int(response.data['manufacturer_part_detail']['pk'])
|
manufacturer_part_id = int(response.data['manufacturer_part_detail']['pk'])
|
||||||
url = reverse('api-manufacturer-part-detail', kwargs={'pk': manufacturer_part_id})
|
url = reverse('api-manufacturer-part-detail', kwargs={'pk': manufacturer_part_id})
|
||||||
response = self.get(url)
|
response = self.get(url)
|
||||||
self.assertEqual(response.data['MPN'], 'PART_NUMBER')
|
self.assertEqual(response.data['MPN'], 'PART_NUMBER')
|
||||||
|
|
||||||
|
# Check link is not modified
|
||||||
|
self.assertEqual(response.data['link'], 'https://www.axel-larsson.se/Exego.aspx?p_id=341&ArtNr=0804020E')
|
||||||
|
|
||||||
|
|
||||||
class SupplierPartTest(InvenTreeAPITestCase):
|
class SupplierPartTest(InvenTreeAPITestCase):
|
||||||
"""Unit tests for the SupplierPart API endpoints"""
|
"""Unit tests for the SupplierPart API endpoints"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user