'In a realm with `restricted_to_domain = False`, you can invite people
with a different domain from that of the realm or your e-mail address.'

def test_invite_outside_domain_in_open_realm(self):

    zulip_realm = get_realm('zulip')
    zulip_realm.restricted_to_domain = False
    zulip_realm.save()
    self.login(self.example_email('hamlet'))
    external_address = 'foo@example.com'
    self.assert_json_success(self.invite(external_address, ['Denmark']))
    self.check_sent_emails([external_address])
