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_urls: Fix get_callback_string logic.

Anders Kaseorgf45b245f74ce
diff --git a/zerver/tests/test_urls.py b/zerver/tests/test_urls.py
index ceb8bda02e5..abde0b3bbaf 100644
--- a/zerver/tests/test_urls.py
+++ b/zerver/tests/test_urls.py
@@ -130,8 +130,7 @@ class PublicURLTest(ZulipTestCase):
class URLResolutionTest(ZulipTestCase):
def get_callback_string(self, pattern: django.urls.resolvers.URLPattern) -> Optional[str]:
- callback_str = hasattr(pattern, "lookup_str") and "lookup_str"
- callback_str = callback_str or "_callback_str"
+ callback_str = "lookup_str" if hasattr(pattern, "lookup_str") else "_callback_str"
return getattr(pattern, callback_str, None)
def check_function_exists(self, module_name: str, view: str) -> None: