tests: Refactor use of test and webhook data fixtures.

This commit is contained in:
Preston Hansen
2018-04-19 20:57:21 -05:00
committed by Tim Abbott
parent 76d6c71595
commit e168f9938c
47 changed files with 67 additions and 76 deletions

View File

@@ -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'])})