From 80b09c84dc77995fbbde6376392f6ae067ba4581 Mon Sep 17 00:00:00 2001 From: Sebastian Grabowski Date: Fri, 8 Mar 2024 08:14:27 +0100 Subject: [PATCH] Call constructor of SavedSearch directly in tests --- GTG/core/saved_searches.py | 5 ----- tests/core/test_saved_search.py | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/GTG/core/saved_searches.py b/GTG/core/saved_searches.py index c091ace2f..f9b45f002 100644 --- a/GTG/core/saved_searches.py +++ b/GTG/core/saved_searches.py @@ -46,11 +46,6 @@ def __init__(self, id: UUID, name: str, query: str) -> None: super().__init__() - # TODO probably not needed - @classmethod - def create(cls, name: str, query: str) -> 'SavedSearch': - return cls(uuid4(), name, query) - @GObject.Property(type=str) def name(self) -> str: """Read only property.""" diff --git a/tests/core/test_saved_search.py b/tests/core/test_saved_search.py index c084d657d..e27d317f3 100644 --- a/tests/core/test_saved_search.py +++ b/tests/core/test_saved_search.py @@ -102,8 +102,8 @@ def test_xml_load_tree(self): def test_xml_write_simple(self): store = SavedSearchStore() - search1 = store.add(SavedSearch.create('Some @tag', 'Looking for some tag')) - search2 = store.add(SavedSearch.create('Some @other @tag', 'Looking for more')) + search1 = store.add(SavedSearch(uuid4(), 'Some @tag', 'Looking for some tag')) + search2 = store.add(SavedSearch(uuid4(), 'Some @other @tag', 'Looking for more')) xml_root = store.to_xml()