Locale: exact match, or empty/[''] as global.
| 41 | |
| 42 | |
| 43 | class TestLocaleSemantics: |
| 44 | """Locale: exact match, or empty/[''] as global.""" |
| 45 | |
| 46 | def test_locale_exact_match(self): |
| 47 | request_locale = "en-US" |
| 48 | ad_locale_match = ["en-US"] |
| 49 | ad_locale_global = [""] |
| 50 | ad_locale_global_empty = [] |
| 51 | # Match: ad has exact |
| 52 | assert request_locale in ad_locale_match |
| 53 | # Match: ad is global ("" or []) |
| 54 | assert "" in ad_locale_global or ad_locale_global_empty == [] |
| 55 | assert "exact" in RULE_LOCALE_EXACT_OR_GLOBAL or "global" in RULE_LOCALE_EXACT_OR_GLOBAL |
| 56 | |
| 57 | def test_no_request_locale_means_no_filter(self): |
| 58 | request_locale = None |
| 59 | # When request has no locale, we don't add a locale filter |
| 60 | assert request_locale is None |
| 61 | |
| 62 | |
| 63 | class TestExclusionsSemantics: |
nothing calls this directly
no outgoing calls
no test coverage detected