From 24a38f26f832343cc9b34a2b0b6abea642fc6f51 Mon Sep 17 00:00:00 2001 From: dgtlmoon Date: Mon, 3 May 2021 11:03:00 +1000 Subject: [PATCH] Prepend 'test-' when runnning under pytest to guid --- backend/store.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/store.py b/backend/store.py index b6043710..3d9749db 100644 --- a/backend/store.py +++ b/backend/store.py @@ -109,11 +109,14 @@ class ChangeDetectionStore: self.add_watch(url='https://www.gov.uk/coronavirus', tag='Covid') self.add_watch(url='https://changedetection.io', tag='Tech news') - self.__data['version_tag'] = "0.292" if not 'app_guid' in self.__data: - self.__data['app_guid'] = str(uuid_builder.uuid4()) + import sys + if "pytest" in sys.modules: + self.__data['app_guid'] = "test-" + str(uuid_builder.uuid4()) + else: + self.__data['app_guid'] = str(uuid_builder.uuid4()) self.needs_write = True