mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 14:35:27 +00:00
test_classes: Merge verbose assertEquals into ZulipTestCase.
This commit is contained in:
committed by
Tim Abbott
parent
e1d35b1e72
commit
94ff443c00
@@ -279,6 +279,18 @@ Output:
|
||||
token=r"[a-z0-9_]{24}"
|
||||
)
|
||||
|
||||
@override
|
||||
def assertEqual(self, first: Any, second: Any, msg: Any = "") -> None:
|
||||
if isinstance(first, str) and isinstance(second, str):
|
||||
if first != second:
|
||||
raise AssertionError(
|
||||
"Actual and expected outputs do not match; showing diff.\n"
|
||||
+ diff_strings(first, second)
|
||||
+ str(msg)
|
||||
)
|
||||
else:
|
||||
super().assertEqual(first, second, msg)
|
||||
|
||||
def set_http_headers(self, extra: dict[str, str], skip_user_agent: bool = False) -> None:
|
||||
if "subdomain" in extra:
|
||||
assert isinstance(extra["subdomain"], str)
|
||||
@@ -2162,20 +2174,6 @@ class ZulipTestCase(ZulipTestCaseMixin, TestCase):
|
||||
return message_id
|
||||
|
||||
|
||||
class ZulipVerboseEqualTestCase(ZulipTestCase):
|
||||
@override
|
||||
def assertEqual(self, first: Any, second: Any, msg: str = "") -> None:
|
||||
if isinstance(first, str) and isinstance(second, str):
|
||||
if first != second:
|
||||
raise AssertionError(
|
||||
"Actual and expected outputs do not match; showing diff.\n"
|
||||
+ diff_strings(first, second)
|
||||
+ msg
|
||||
)
|
||||
else:
|
||||
super().assertEqual(first, second)
|
||||
|
||||
|
||||
def get_row_ids_in_all_tables() -> Iterator[tuple[str, set[int]]]:
|
||||
all_models = apps.get_models(include_auto_created=True)
|
||||
ignored_tables = {"django_session"}
|
||||
|
||||
Reference in New Issue
Block a user