populate_db: Add a "lear" realm for testing cross-realm email sharing.

We don't yet actually allow sharing emails across realms, but we
will soon.  This lets us start testing some pieces of those changes.
This commit is contained in:
Greg Price 2017-11-27 17:42:11 -08:00
parent 5f38b374b6
commit a753f49e6a
1 changed files with 9 additions and 0 deletions

View File

@ -133,6 +133,10 @@ class Command(BaseCommand):
invite_required=False, org_type=Realm.CORPORATE) invite_required=False, org_type=Realm.CORPORATE)
RealmDomain.objects.create(realm=mit_realm, domain="mit.edu") RealmDomain.objects.create(realm=mit_realm, domain="mit.edu")
lear_realm = Realm.objects.create(
string_id="lear", name="Lear & Co.", restricted_to_domain=False,
invite_required=False, org_type=Realm.CORPORATE)
# Create test Users (UserProfiles are automatically created, # Create test Users (UserProfiles are automatically created,
# as are subscriptions to the ability to receive personals). # as are subscriptions to the ability to receive personals).
names = [ names = [
@ -307,6 +311,11 @@ class Command(BaseCommand):
] ]
create_users(mit_realm, testsuite_mit_users) create_users(mit_realm, testsuite_mit_users)
testsuite_lear_users = [
("King Lear", "king@lear.org"),
]
create_users(lear_realm, testsuite_lear_users)
if not options["test_suite"]: if not options["test_suite"]:
# Initialize the email gateway bot as an API Super User # Initialize the email gateway bot as an API Super User
email_gateway_bot = get_system_bot(settings.EMAIL_GATEWAY_BOT) email_gateway_bot = get_system_bot(settings.EMAIL_GATEWAY_BOT)