Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

test_microsoft_teams_importer: Fix check that never ran.

PieterCKd16e9173f463
diff --git a/zerver/tests/test_microsoft_teams_importer.py b/zerver/tests/test_microsoft_teams_importer.py
index c169372c4d3..32c0870312a 100644
--- a/zerver/tests/test_microsoft_teams_importer.py
+++ b/zerver/tests/test_microsoft_teams_importer.py
@@ -668,14 +668,12 @@ class MicrosoftTeamsImporterUnitTest(MicrosoftTeamsImportTestCase):
self.assertEqual("HTTP error accessing the Microsoft Graph API.", str(e.exception))
def test_get_user_roles(self) -> None:
- with (
- self.subTest("No global administrator role found"),
- self.assertRaises(AssertionError) as e,
- ):
- # This is primarily only for test coverage, it's likely a very rare case since
- # this role is one of the built-in roles.
- self.get_user_roles_handler(directory_roles_response_fixture=None)
- self.assertEqual( # nocoverage
+ with self.subTest("No global administrator role found"):
+ with self.assertRaises(AssertionError) as e:
+ # This is primarily only for test coverage, it's likely a very rare case since
+ # this role is one of the built-in roles.
+ self.get_user_roles_handler(directory_roles_response_fixture=None)
+ self.assertEqual(
"Could not find Microsoft Teams organization owners/administrators.",
str(e.exception),
)