diff --git a/grapple/settings.py b/grapple/settings.py index 3b723042..c543eca5 100644 --- a/grapple/settings.py +++ b/grapple/settings.py @@ -72,7 +72,7 @@ def user_settings(self): def __getattr__(self, attr): if attr not in self.defaults: - raise AttributeError("Invalid Grapple setting: '%s'" % attr) + raise AttributeError(f"Invalid Grapple setting: '{attr}'") try: # Check if present in user settings diff --git a/tests/test_image_types.py b/tests/test_image_types.py index 5f6fbc7e..a80615ea 100644 --- a/tests/test_image_types.py +++ b/tests/test_image_types.py @@ -90,18 +90,15 @@ def test_renditions(self): def test_renditions_with_allowed_image_filters_restrictions(self): def get_query(**kwargs): params = ",".join([f"{key}: {value}" for key, value in kwargs.items()]) - return ( - """ - query ($id: ID!) { - image(id: $id) { - rendition(%s) { - url - } - } - } - """ - % params - ) + return f""" + query ($id: ID!) {{ + image(id: $id) {{ + rendition({params}) {{ + url + }} + }} + }} + """ results = self.client.execute( get_query(width=100), variables={"id": self.example_image.id}