mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
webui tests: fix assertion in test_subid.py
The test wants to check the error related to an exception obtained inside a "with pytest.raises" instruction. The object is an ExceptionInfo and offers a match method to check the content of the string representation. Use this match() method instead of str(excinfo) which now returns '<ExceptionInfo NoSuchElementException() tblen=10>' Fixes: https://pagure.io/freeipa/issue/9282 Signed-off-by: Florence Blanc-Renaud <flo@redhat.com> Reviewed-By: Mohammad Rizwan Yusuf <myusuf@redhat.com>
This commit is contained in:
@@ -146,5 +146,5 @@ class test_subid(UI_driver):
|
||||
with pytest.raises(NoSuchElementException) as excinfo:
|
||||
self.delete_record(admin_uid, table_name="ipauniqueid")
|
||||
# Ensure that the exception is really related to missing remove button
|
||||
msg = "Unable to locate element: .facet-controls button[name=remove]"
|
||||
assert msg in str(excinfo)
|
||||
msg = r"Unable to locate element: .facet-controls button\[name=remove\]"
|
||||
assert excinfo.match(msg)
|
||||
|
||||
Reference in New Issue
Block a user