mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Allow longer timeout for image download tests
This commit is contained in:
parent
1f1a4d85fd
commit
e1ce13043f
@ -267,7 +267,7 @@ class TestHelpers(TestCase):
|
||||
|
||||
# Attempt to download an image which throws a 404
|
||||
with self.assertRaises(requests.exceptions.HTTPError):
|
||||
helpers.download_image_from_url("https://httpstat.us/404")
|
||||
helpers.download_image_from_url("https://httpstat.us/404", timeout=10)
|
||||
|
||||
# Attempt to download, but timeout
|
||||
with self.assertRaises(requests.exceptions.Timeout):
|
||||
@ -275,7 +275,7 @@ class TestHelpers(TestCase):
|
||||
|
||||
# Attempt to download, but not a valid image
|
||||
with self.assertRaises(TypeError):
|
||||
helpers.download_image_from_url("https://httpstat.us/200")
|
||||
helpers.download_image_from_url("https://httpstat.us/200", timeout=10)
|
||||
|
||||
large_img = "https://github.com/inventree/InvenTree/raw/master/InvenTree/InvenTree/static/img/paper_splash_large.jpg"
|
||||
|
||||
@ -283,13 +283,13 @@ class TestHelpers(TestCase):
|
||||
|
||||
# Attempt to download an image which is too large
|
||||
with self.assertRaises(ValueError):
|
||||
helpers.download_image_from_url(large_img)
|
||||
helpers.download_image_from_url(large_img, timeout=10)
|
||||
|
||||
# Increase allowable download size
|
||||
InvenTreeSetting.set_setting('INVENTREE_DOWNLOAD_IMAGE_MAX_SIZE', 5, change_user=None)
|
||||
|
||||
# Download a valid image (should not throw an error)
|
||||
helpers.download_image_from_url(large_img)
|
||||
helpers.download_image_from_url(large_img, timeout=10)
|
||||
|
||||
|
||||
class TestQuoteWrap(TestCase):
|
||||
|
Loading…
Reference in New Issue
Block a user