国内可访问服务替换排查:新增蜜罐反垃圾字段 + CDN 加速域名配置
This commit is contained in:
@@ -80,6 +80,26 @@ def test_lead_submit_requires_form_id():
|
||||
assert response.status_code == 400
|
||||
|
||||
|
||||
def test_lead_submit_honeypot_filled_silently_rejects_without_creating_lead(
|
||||
contact_form,
|
||||
):
|
||||
"""蜜罐字段非空视为机器人:返回“成功”假象但不落库、不发通知邮件。"""
|
||||
client = APIClient()
|
||||
response = client.post(
|
||||
"/api/v1/custom/leads/",
|
||||
{
|
||||
"form_id": contact_form.pk,
|
||||
"data": {"name": "张三"},
|
||||
"website": "http://spam.example.com",
|
||||
},
|
||||
format="json",
|
||||
)
|
||||
|
||||
assert response.status_code == 201
|
||||
assert response.data["success"] is True
|
||||
assert not Lead.objects.exists()
|
||||
|
||||
|
||||
# --- PIPL 数据删除权(详见设计文档 §2.15) ---
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user