mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	users: Remove unnecessary get_api_key helper.
Using the column name is clearer.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							8804c1afaa
						
					
				
				
					commit
					a7d513e5ec
				
			@@ -1,5 +1,4 @@
 | 
			
		||||
from zerver.lib.test_classes import WebhookTestCase
 | 
			
		||||
from zerver.lib.users import get_api_key
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class DropboxHookTests(WebhookTestCase):
 | 
			
		||||
@@ -20,7 +19,7 @@ class DropboxHookTests(WebhookTestCase):
 | 
			
		||||
 | 
			
		||||
    def test_verification_request(self) -> None:
 | 
			
		||||
        self.subscribe(self.test_user, self.CHANNEL_NAME)
 | 
			
		||||
        get_params = {"stream_name": self.CHANNEL_NAME, "api_key": get_api_key(self.test_user)}
 | 
			
		||||
        get_params = {"stream_name": self.CHANNEL_NAME, "api_key": self.test_user.api_key}
 | 
			
		||||
        result = self.client_get(self.url, get_params)
 | 
			
		||||
        self.assert_json_error(result, "Missing 'challenge' argument", 400)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,6 @@ from unittest.mock import patch
 | 
			
		||||
from urllib.parse import quote, unquote
 | 
			
		||||
 | 
			
		||||
from zerver.lib.test_classes import WebhookTestCase
 | 
			
		||||
from zerver.lib.users import get_api_key
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class JiraHookTests(WebhookTestCase):
 | 
			
		||||
@@ -11,7 +10,7 @@ class JiraHookTests(WebhookTestCase):
 | 
			
		||||
    WEBHOOK_DIR_NAME = "jira"
 | 
			
		||||
 | 
			
		||||
    def test_custom_channel(self) -> None:
 | 
			
		||||
        api_key = get_api_key(self.test_user)
 | 
			
		||||
        api_key = self.test_user.api_key
 | 
			
		||||
        self.subscribe(self.test_user, "jira_custom")
 | 
			
		||||
        url = f"/api/v1/external/jira?api_key={api_key}&stream=jira_custom"
 | 
			
		||||
        msg = self.send_webhook_payload(
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user