Initial commit: Odoo 18.0-20251222 extra-addons
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
tests / Detect unreleased dependencies (push) Has been cancelled
tests / test with OCB (push) Has been cancelled
tests / test with Odoo (push) Has been cancelled

This commit is contained in:
tocmo0nlord
2026-03-13 20:43:25 +00:00
parent 36e847a7df
commit adbe430761
9472 changed files with 1265727 additions and 0 deletions

48
sentry/tests/test_processor.py Executable file
View File

@@ -0,0 +1,48 @@
from odoo.tests import TransactionCase
from .. import processor
class TestSanitizers(TransactionCase):
def test_sanitize_password(self):
sanitizer = processor.SanitizePasswordsProcessor()
for password in [
"1234-5678-9012-3456",
"1234 5678 9012 3456",
"1234 - 5678- -0987---1234",
"123456789012345",
]:
with self.subTest(
password=password,
msg="password should have been sanitized",
):
self.assertEqual(
sanitizer.sanitize(None, password),
sanitizer.MASK,
)
for not_password in [
"1234",
"hello",
"text long enough",
"numbers and 73X7",
"12345678901234567890",
b"12345678901234567890",
b"1234 5678 9012 3456",
"1234-5678-9012-3456-7890",
]:
with self.subTest(
not_password=password,
msg="not_password should not have been sanitized",
):
self.assertEqual(
sanitizer.sanitize(None, not_password),
not_password,
)
def test_sanitize_keys(self):
sanitizer = processor.SanitizeKeysProcessor()
self.assertIsNone(sanitizer.sanitize_keys)
def test_sanitize_none(self):
sanitizer = processor.SanitizePasswordsProcessor()
self.assertIsNone(sanitizer.sanitize(None, None))