Move hardcore position filtering policy
This commit is contained in:
@@ -1242,6 +1242,69 @@ def smoke_hardcore_position_config_policy() -> None:
|
||||
_expect(filtered.get("allow_penetration") is False, "Hardcore outercourse focus should disable penetration")
|
||||
_expect("outercourse_sex" in hardcore_position_config.hardcore_allowed_subcategory_slugs(filtered), "Allowed subcategories lost outercourse")
|
||||
_expect("oral_sex" not in hardcore_position_config.hardcore_allowed_subcategory_slugs(filtered), "Allowed subcategories should exclude oral")
|
||||
action_only = json.loads(
|
||||
hardcore_position_config.build_hardcore_action_filter_json(
|
||||
focus="outercourse_only",
|
||||
allow_toys=False,
|
||||
allow_double=False,
|
||||
allow_penetration=True,
|
||||
allow_foreplay=True,
|
||||
allow_interaction=True,
|
||||
allow_manual=True,
|
||||
allow_oral=True,
|
||||
allow_outercourse=True,
|
||||
allow_anal=True,
|
||||
allow_climax=True,
|
||||
)
|
||||
)
|
||||
action_axis = hardcore_position_config.filter_hardcore_axis(
|
||||
"outer_act",
|
||||
["boobjob body contact", "blowjob oral sex", "vaginal penetration"],
|
||||
action_only,
|
||||
)
|
||||
_expect(action_axis == ["boobjob body contact"], "Hardcore action filter policy did not block disabled oral/penetration text")
|
||||
position_filtered = hardcore_position_config.apply_hardcore_position_config_to_subcategory(
|
||||
{
|
||||
"slug": "oral_sex",
|
||||
"item_templates": [
|
||||
{"template": "oral contact in {position}"},
|
||||
{"template": "oral sex without a position axis"},
|
||||
{"template": "unsupported static template"},
|
||||
],
|
||||
"item_axes": {
|
||||
"position": ["standing oral position", "kneeling oral position"],
|
||||
"oral_act": ["blowjob", "cunnilingus"],
|
||||
},
|
||||
},
|
||||
base,
|
||||
)
|
||||
_expect(
|
||||
position_filtered["item_templates"] == [{"template": "oral contact in {position}"}],
|
||||
"Hardcore position policy did not filter templates by selected position requirements",
|
||||
)
|
||||
_expect(
|
||||
position_filtered["item_axes"]["position"] == ["standing oral position"],
|
||||
"Hardcore position policy did not filter position axes by selected keys",
|
||||
)
|
||||
filtered_categories = hardcore_position_config.filter_hardcore_categories_for_position(
|
||||
[
|
||||
{
|
||||
"name": "Hardcore sexual poses",
|
||||
"slug": "hardcore_sexual_poses",
|
||||
"subcategories": [{"slug": "oral_sex"}, {"slug": "outercourse_sex"}],
|
||||
},
|
||||
{"name": "Casual clothes", "slug": "casual_clothes", "subcategories": [{"slug": "tops"}]},
|
||||
],
|
||||
filtered,
|
||||
1,
|
||||
1,
|
||||
lambda _entry, _women, _men: True,
|
||||
)
|
||||
_expect(
|
||||
[entry["slug"] for entry in filtered_categories[0]["subcategories"]] == ["outercourse_sex"],
|
||||
"Hardcore category filter policy did not remove disallowed subcategories",
|
||||
)
|
||||
_expect(filtered_categories[1]["slug"] == "casual_clothes", "Hardcore category filter should preserve non-hardcore categories")
|
||||
|
||||
keys = pb._hardcore_position_keys("woman on all fours from behind", axis_values={"position": "doggy"})
|
||||
_expect(keys == ["doggy"], "Hardcore position key detection changed")
|
||||
|
||||
Reference in New Issue
Block a user