From bc710a587524cf26ec8bfc642dc6a09c0a76d4b7 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Fri, 30 Jun 2023 16:09:50 +0200 Subject: [PATCH] only write if set --- changedetectionio/tests/util.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/changedetectionio/tests/util.py b/changedetectionio/tests/util.py index 50671f3d..904c1b62 100644 --- a/changedetectionio/tests/util.py +++ b/changedetectionio/tests/util.py @@ -205,8 +205,9 @@ def live_server_setup(live_server): with open("test-datastore/notification-url.txt", "w") as f: f.write(request.url) - with open("test-datastore/notification-content-type.txt", "w") as f: - f.write(request.content_type) + if request.content_type: + with open("test-datastore/notification-content-type.txt", "w") as f: + f.write(request.content_type) print("\n>> Test notification endpoint was hit.\n", data) return "Text was set"