Reference catalog of GDPR-aligned test patterns - data-subject-rights workflows (Art. 15 access, Art. 16 rectification, Art. 17 erasure / "right to be forgotten", Art. 18 restriction, Art. 20 portability, Art. 21 objection); consent recording + revocation per Art. 7; data-residency assertions per Art. 44 - 50 international transfers; breach-notification timing tests per Art. 33 (72 hours); data-minimization assertions in fixtures per Art. 5(1)(c). The California analogue - CCPA/CPRA patterns by Cal. Civ. Code section, including Global Privacy Control (GPC) opt-out, right-to-know, deletion, right-to-correct, and sensitive-PI limits - lives in references/ccpa.md. Use when authoring GDPR- or CCPA/CPRA-readiness tests for any product processing EU or California personal data.
72
91%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Companion reference for gdpr-test-patterns - the California analogue of the
per-Article GDPR catalog, organized by Cal. Civ. Code section.
Per oag.ca.gov/privacy/ccpa (California Attorney General authoritative source):
CCPA (California Consumer Privacy Act, in force 2020-01-01) and CPRA (California Privacy Rights Act, in force 2023-01-01) apply to businesses meeting one of three thresholds:
Failure carries civil penalties up to $7,500 per intentional violation + $2,500 per non-intentional violation; private right of action for data breaches.
This reference defines the test-pattern catalog by Cal. Civ. Code
section. The host skill gdpr-test-patterns covers the EU side of
the international compliance footprint.
CPRA mandates honoring the GPC browser signal (per globalprivacycontrol.org):
def test_gpc_signal_blocks_sale_and_share():
response = client.get('/page', headers={'Sec-GPC': '1'})
# Page MUST treat the visitor as opted-out:
assert 'do-not-sell-cookie' in response.cookies
# Tracking pixels for sale/share must NOT fire:
assert 'analytics-share.js' not in response.text
assert 'ads-third-party.js' not in response.text
# Status MUST be recorded for compliance evidence:
assert OptOutRecord.objects.filter(visitor_id=session_id).exists()def test_consumer_request_returns_all_pi_categories():
response = client.post('/privacy/right-to-know', json={
'consumer_email': 'alice@example.com'
})
body = response.json()
# CCPA Cat. 11 personal info categories:
expected = {
'identifiers',
'commercial_info',
'biometric_info',
'internet_activity',
'geolocation_data',
'professional_or_employment',
'inferences',
}
# Test asserts every category present in response (NULL acceptable):
for cat in expected:
assert cat in bodydef test_deletion_request_completes_within_45_days():
request = DeletionRequest.create(consumer_email='alice@example.com')
# CCPA: 45 days, extendable by 45 more (90 max) with notice
deadline = request.received_at + timedelta(days=45)
completion = DeletionRequest.objects.get(id=request.id)
assert completion.status == 'completed'
assert completion.completed_at <= deadlinedef test_limit_sensitive_pi_use():
# Consumer requests limit on sensitive PI (per CPRA SPI categories)
submit_limit_request(consumer='alice@example.com')
# Subsequent processing MUST NOT use SPI for inference / advertising:
response = client.get('/recommendations', headers={'X-Consumer-Email': 'alice@example.com'})
# Recommendations engine MUST NOT use SPI (geolocation, racial, religious, etc.):
used_features = response.json()['feature_attribution']
forbidden_spi = {'precise_geolocation', 'racial_ethnic', 'religious', 'union_membership'}
for feature in used_features:
assert feature not in forbidden_spidef test_correction_request_updates_records_within_45_days():
submit_correction(consumer='alice@example.com', field='name', value='Alice Smith')
deadline = timezone.now() + timedelta(days=45)
# All systems must reflect the correction:
assert User.objects.get(email='alice@example.com').name == 'Alice Smith'
assert BillingRecord.objects.get(user_email='alice@example.com').name == 'Alice Smith'
# Third parties that received the prior incorrect value must be notified:
assert NotificationLog.objects.filter(
type='correction_propagation',
recipient='third-party-vendor@example.com',
).exists()def test_privacy_policy_disclosed_at_collection():
# Every PI collection point must disclose categories + purposes
response = client.get('/signup')
assert 'privacy-notice' in response.text
assert any(link in response.text for link in [
'/do-not-sell-or-share',
'/limit-sensitive-pi-use',
])
# Disclosed categories MUST match what's actually collected
disclosed = parse_privacy_notice(response.text)
actual = analyze_signup_form(response.text)
assert disclosed >= actual # disclosure is superset of collection| Category | Examples |
|---|---|
| Government IDs | SSN, driver's license, passport, alien registration |
| Account login + credentials | Username + password / security questions |
| Precise geolocation | <1850 ft / 564 m radius |
| Racial / ethnic origin | Self-reported demographics |
| Religious / philosophical beliefs | Religious affiliation |
| Union membership | Trade union status |
| Communication content | Email body, SMS body, message content |
| Genetic data | DNA test results |
| Biometric for unique identification | Faceprint, voiceprint, fingerprint |
| Health info | Medical history, medications |
| Sexual orientation / sex life | Self-reported orientation |
Test patterns above (§1798.121) protect these categories specifically.
| Anti-pattern | Why it fails | Fix |
|---|---|---|
| Honor opt-out cookie but ignore GPC header | CPRA mandates GPC support | Step §1798.135 GPC test |
| Right-to-know returns only main app data | Misses analytics, CRM | Multi-system response (Step §1798.110) |
| Correction propagated only locally | Third parties retain incorrect data | Notification log assertion (Step §1798.106) |
| SPI categorical restriction tested only at API edge | Inference engines bypass | Feature-attribution-level test (Step §1798.121) |
| Test fixtures use real California PII | CCPA violation in tests | synthetic-pii-generator |
gdpr-test-patterns - host skill: EU analoguesynthetic-pii-generator - safe test data generationaudit-trail-test-author - audit log requirements