Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
test_invite: Use context manager form of assertRaises.
Anders Kaseorg9efba89a4363
diff --git a/zerver/tests/test_invite.py b/zerver/tests/test_invite.pyindex 3afe4ea9a28..d2de3bf48bf 100644--- a/zerver/tests/test_invite.py+++ b/zerver/tests/test_invite.py@@ -13,7 +13,6 @@ from django.http import HttpRequestfrom django.test import override_settingsfrom django.urls import reversefrom django.utils.timezone import now as timezone_now-from returns.curry import partialfrom typing_extensions import overridefrom confirmation import settings as confirmation_settings@@ -1113,10 +1112,8 @@ so we didn't send them an invitation. We did send invitations to everyone else!"# We only created accounts for the new users.for email in existing:- self.assertRaises(- PreregistrationUser.DoesNotExist,- partial(PreregistrationUser.objects.get, email=email),- )+ with self.assertRaises(PreregistrationUser.DoesNotExist):+ PreregistrationUser.objects.get(email=email)for email in new:self.assertTrue(PreregistrationUser.objects.get(email=email))