You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
self = <unittest.case._Outcome object at 0x7f6ec5bdb770>
test_case = <authentik.enterprise.policies.unique_password.tests.test_policy.TestUniquePasswordPolicy testMethod=test_invalid>
subTest = False
@contextlib.contextmanager
def testPartExecutor(self, test_case, subTest=False):
old_success = self.success
self.success = True
try:
> yield
.../hostedtoolcache/Python/3.13.9................../x64/lib/python3.13/unittest/case.py:58:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <authentik.enterprise.policies.unique_password.tests.test_policy.TestUniquePasswordPolicy testMethod=test_invalid>
result = <TestCaseFunction test_invalid>
def run(self, result=None):
if result is None:
result = self.defaultTestResult()
startTestRun = getattr(result, 'startTestRun', None)
stopTestRun = getattr(result, 'stopTestRun', None)
if startTestRun is not None:
startTestRun()
else:
stopTestRun = None
result.startTest(self)
try:
testMethod = getattr(self, self._testMethodName)
if (getattr(self.__class__, "__unittest_skip__", False) or
getattr(testMethod, "__unittest_skip__", False)):
# If the class or method was skipped.
skip_why = (getattr(self.__class__, '__unittest_skip_why__', '')
or getattr(testMethod, '__unittest_skip_why__', ''))
_addSkip(result, self, skip_why)
return result
expecting_failure = (
getattr(self, "__unittest_expecting_failure__", False) or
getattr(testMethod, "__unittest_expecting_failure__", False)
)
outcome = _Outcome(result)
start_time = time.perf_counter()
try:
self._outcome = outcome
with outcome.testPartExecutor(self):
self._callSetUp()
if outcome.success:
outcome.expecting_failure = expecting_failure
with outcome.testPartExecutor(self):
> self._callTestMethod(testMethod)
.../hostedtoolcache/Python/3.13.9................../x64/lib/python3.13/unittest/case.py:651:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <authentik.enterprise.policies.unique_password.tests.test_policy.TestUniquePasswordPolicy testMethod=test_invalid>
method = <bound method TestUniquePasswordPolicy.test_invalid of <authentik.enterprise.policies.unique_password.tests.test_policy.TestUniquePasswordPolicy testMethod=test_invalid>>
def _callTestMethod(self, method):
> if method() is not None:
.../hostedtoolcache/Python/3.13.9................../x64/lib/python3.13/unittest/case.py:606:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <authentik.enterprise.policies.unique_password.tests.test_policy.TestUniquePasswordPolicy testMethod=test_invalid>
def test_invalid(self):
"""Test without password present in request"""
request = PolicyRequest(get_anonymous_user())
result: PolicyResult = self.policy.passes(request)
self.assertFalse(result.passing)
> self.assertEqual(result.messages[0], "Password not set in context")
.../unique_password/tests/test_policy.py:30:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <authentik.enterprise.policies.unique_password.tests.test_policy.TestUniquePasswordPolicy testMethod=test_invalid>
first = 'Mot de passe non défini dans le contexte'
second = 'Password not set in context', msg = None
def assertEqual(self, first, second, msg=None):
"""Fail if the two objects are unequal as determined by the '=='
operator.
"""
assertion_func = self._getAssertEqualityFunc(first, second)
> assertion_func(first, second, msg=msg)
.../hostedtoolcache/Python/3.13.9................../x64/lib/python3.13/unittest/case.py:907:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <authentik.enterprise.policies.unique_password.tests.test_policy.TestUniquePasswordPolicy testMethod=test_invalid>
first = 'Mot de passe non défini dans le contexte'
second = 'Password not set in context', msg = None
def assertMultiLineEqual(self, first, second, msg=None):
"""Assert that two multi-line strings are equal."""
self.assertIsInstance(first, str, "First argument is not a string")
self.assertIsInstance(second, str, "Second argument is not a string")
if first != second:
# Don't use difflib if the strings are too long
if (len(first) > self._diffThreshold or
len(second) > self._diffThreshold):
self._baseAssertEqual(first, second, msg)
# Append \n to both strings if either is missing the \n.
# This allows the final ndiff to show the \n difference. The
# exception here is if the string is empty, in which case no
# \n should be added
first_presplit = first
second_presplit = second
if first and second:
if first[-1] != '\n' or second[-1] != '\n':
first_presplit += '\n'
second_presplit += '\n'
elif second and second[-1] != '\n':
second_presplit += '\n'
elif first and first[-1] != '\n':
first_presplit += '\n'
firstlines = first_presplit.splitlines(keepends=True)
secondlines = second_presplit.splitlines(keepends=True)
# Generate the message and diff, then raise the exception
standardMsg = '%s != %s' % _common_shorten_repr(first, second)
diff = '\n' + ''.join(difflib.ndiff(firstlines, secondlines))
standardMsg = self._truncateMessage(standardMsg, diff)
> self.fail(self._formatMessage(msg, standardMsg))
.../hostedtoolcache/Python/3.13.9................../x64/lib/python3.13/unittest/case.py:1273:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <authentik.enterprise.policies.unique_password.tests.test_policy.TestUniquePasswordPolicy testMethod=test_invalid>
msg = "'Mot de passe non défini dans le contexte' != 'Password not set in context'\n- Mot de passe non défini dans le contexte\n+ Password not set in context\n"
def fail(self, msg=None):
"""Fail immediately, with the given message."""
> raise self.failureException(msg)
E AssertionError: 'Mot de passe non défini dans le contexte' != 'Password not set in context'
E - Mot de passe non défini dans le contexte
E + Password not set in context
.../hostedtoolcache/Python/3.13.9................../x64/lib/python3.13/unittest/case.py:732: AssertionError
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
area:frontendFeatures or issues related to the browser, TypeScript, Node.js, etci18nInternationalization and localization
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details
TBD