Skip to content

Commit d3f008b

Browse files
authored
Update Strawberry to 0.324.0 (#4724)
1 parent 95a1680 commit d3f008b

5 files changed

Lines changed: 44 additions & 7 deletions

File tree

backend/api/cms/page/registry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def get_block_union():
2727
import glob
2828

2929
# Import all blocks to register them
30-
for file_ in glob.glob("api/cms/*/blocks/*.py"):
30+
for file_ in sorted(glob.glob("api/cms/*/blocks/*.py")):
3131
module_path = file_.replace("/", ".").replace(".py", "")
3232
importlib.import_module(module_path)
3333

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
from unittest.mock import call, patch
2+
3+
import strawberry
4+
5+
from api.cms.page.registry import REGISTRY, get_block_union
6+
7+
8+
def test_get_block_union_imports_blocks_in_sorted_order():
9+
@strawberry.type
10+
class FirstBlock:
11+
value: str
12+
13+
@strawberry.type
14+
class SecondBlock:
15+
value: str
16+
17+
with (
18+
patch(
19+
"glob.glob",
20+
return_value=[
21+
"api/cms/page/blocks/second.py",
22+
"api/cms/page/blocks/first.py",
23+
],
24+
),
25+
patch("importlib.import_module") as import_module,
26+
patch.dict(
27+
REGISTRY,
28+
{"first": FirstBlock, "second": SecondBlock},
29+
clear=True,
30+
),
31+
):
32+
get_block_union()
33+
34+
assert import_module.call_args_list == [
35+
call("api.cms.page.blocks.first"),
36+
call("api.cms.page.blocks.second"),
37+
]

backend/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ dependencies = [
6767
"django-queryinspect<2.0.0,>=1.1.0",
6868
"lxml==6.1.0",
6969
"unidecode<2.0.0,>=1.1.1",
70-
"strawberry-graphql==0.318.1",
70+
"strawberry-graphql==0.324.0",
7171
"Werkzeug>=1.0.1,<4.0.0",
7272
"django-import-export<4.0.0,>=3.2.0",
7373
"dal-admin-filters==1.1.0",

backend/schema.graphql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ type BillingAddress {
112112
pec: String!
113113
}
114114

115-
union Block = NewsGridSection | CommunitiesSection | SliderCardsSection | SponsorsSection | SchedulePreviewSection | TextSection | DynamicContentDisplaySection | SpecialGuestSection | LiveStreamingSection | InformationSection | CheckoutSection | SocialsSection | KeynotersSection | HomepageHero | HomeIntroSection | CMSMap
115+
union Block = CMSMap | HomeIntroSection | NewsGridSection | CheckoutSection | CommunitiesSection | DynamicContentDisplaySection | HomepageHero | InformationSection | KeynotersSection | LiveStreamingSection | SchedulePreviewSection | SliderCardsSection | SocialsSection | SpecialGuestSection | SponsorsSection | TextSection
116116

117117
enum BodyTextSize {
118118
TEXT_1

backend/uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)