mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
tests: Refactor use of test and webhook data fixtures.
This commit is contained in:
committed by
Tim Abbott
parent
76d6c71595
commit
e168f9938c
@@ -40,7 +40,7 @@ class GithubV1HookTests(WebhookTestCase):
|
||||
|
||||
def get_body(self, fixture_name: Text) -> Dict[str, Text]:
|
||||
api_key = self.test_user.api_key
|
||||
data = ujson.loads(self.fixture_data(self.FIXTURE_DIR_NAME, 'v1_' + fixture_name))
|
||||
data = ujson.loads(self.webhook_fixture_data(self.FIXTURE_DIR_NAME, 'v1_' + fixture_name))
|
||||
data.update({'email': self.TEST_USER_EMAIL,
|
||||
'api-key': api_key,
|
||||
'payload': ujson.dumps(data['payload'])})
|
||||
@@ -165,7 +165,7 @@ class GithubV2HookTests(WebhookTestCase):
|
||||
|
||||
def get_body(self, fixture_name: Text) -> Dict[str, Text]:
|
||||
api_key = self.test_user.api_key
|
||||
data = ujson.loads(self.fixture_data(self.FIXTURE_DIR_NAME, 'v2_' + fixture_name))
|
||||
data = ujson.loads(self.webhook_fixture_data(self.FIXTURE_DIR_NAME, 'v2_' + fixture_name))
|
||||
data.update({'email': self.TEST_USER_EMAIL,
|
||||
'api-key': api_key,
|
||||
'payload': ujson.dumps(data['payload'])})
|
||||
|
||||
Reference in New Issue
Block a user