tools: Use get_user in test-api.

This commit is contained in:
Vishnu Ks 2017-07-19 19:05:08 +05:30 committed by Tim Abbott
parent 084fc9c32a
commit fdafe69ba1
1 changed files with 3 additions and 2 deletions

View File

@ -20,12 +20,13 @@ from tools.lib.api_tests import test_the_api
os.environ['DJANGO_SETTINGS_MODULE'] = 'zproject.test_settings'
django.setup()
from zerver.models import get_user_profile_by_email
from zerver.models import get_user, get_realm
with test_server_running():
email = 'iago@zulip.com' # Iago is an admin
api_key = get_user_profile_by_email(email).api_key
realm = get_realm("zulip")
api_key = get_user(email, realm).api_key
site = 'http://127.0.0.1:9981'
client = Client(