2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-18 21:15:41 +00:00

Default expiry fix (#5466)

* Handle null values for expiry date

* Add unit test for new case

* Unit test fix

* More unit test fixes
This commit is contained in:
Oliver
2023-08-23 16:03:01 +10:00
committed by GitHub
parent 25a1380058
commit 5851094620
3 changed files with 32 additions and 35 deletions

View File

@ -136,7 +136,9 @@ class LabelTest(InvenTreeAPITestCase):
# Print via the API (Note: will default to the builtin plugin if no plugin supplied)
url = reverse('api-part-label-print', kwargs={'pk': label.pk})
part_pk = Part.objects.first().pk
prt = Part.objects.first()
part_pk = prt.pk
part_name = prt.name
response = self.get(f'{url}?parts={part_pk}', expected_code=200)
data = json.loads(response.content)
@ -150,7 +152,7 @@ class LabelTest(InvenTreeAPITestCase):
content = f.read()
# Test that each element has been rendered correctly
self.assertIn("part: 1 - M2x4 LPHS", content)
self.assertIn(f"part: {part_pk} - {part_name}", content)
self.assertIn(f'data: {{"part": {part_pk}}}', content)
self.assertIn("http://testserver/part/1/", content)
self.assertIn("img/blank_image.png", content)