populate_db, tests: Restrict emails in zulip realm.

We now restrict emails on the zulip realm, and now
`email` and `delivery_email` will be different for
users.

This change should make it more likely to catch
errors where we leak delivery emails or use the
wrong field for lookups.
This commit is contained in:
Steve Howell
2020-03-12 12:51:54 +00:00
committed by Tim Abbott
parent f647587675
commit eb9a252ec9
6 changed files with 37 additions and 15 deletions

View File

@@ -33,14 +33,17 @@ with test_server_running(force=options.force, external_host='zulipdev.com:9981')
from zerver.openapi.python_examples import test_the_api, test_invalid_api_key
from zerver.openapi.test_curl_examples import test_generated_curl_examples_for_success
from zerver.lib.actions import do_create_user
from zerver.lib.test_helpers import reset_emails_in_zulip_realm
from zerver.lib.users import get_api_key
from zerver.models import get_user, get_realm
print("Running API tests...")
reset_emails_in_zulip_realm()
# Prepare the admin client
email = 'iago@zulip.com' # Iago is an admin
realm = get_realm("zulip")
realm = get_realm('zulip')
user = get_user(email, realm)
api_key = get_api_key(user)
site = 'http://zulip.zulipdev.com:9981'