tests: Move find_by_id to ZulipTestCase.

This commit is contained in:
Vishnu Ks
2019-05-21 15:59:09 +05:30
committed by Tim Abbott
parent 68387b9f00
commit 3f24cc4b86
2 changed files with 9 additions and 14 deletions

View File

@@ -706,6 +706,11 @@ class ZulipTestCase(TestCase):
values = set(r[field] for r in data)
return values
def find_by_id(self, data: List[Dict[str, Any]], db_id: int) -> Dict[str, Any]:
return [
r for r in data
if r['id'] == db_id][0]
class WebhookTestCase(ZulipTestCase):
"""
Common for all webhooks tests