mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	test_emails: Make fixture values more helpful for visual review.
Also fixes the fact that we were pulling assets from chat.zulip.org.
This commit is contained in:
		@@ -46,7 +46,7 @@ class DocPageTest(ZulipTestCase):
 | 
			
		||||
                           "https://my.pingdom.com/reports/integration/settings",
 | 
			
		||||
                       ])
 | 
			
		||||
            self._test('/devlogin/', 'Normal users')
 | 
			
		||||
            self._test('/emails/', 'Zooly Zulipson invited you to join Zulip')
 | 
			
		||||
            self._test('/emails/', 'Road Runner invited you to join Zulip')
 | 
			
		||||
            self._test('/register/', 'Sign up for Zulip')
 | 
			
		||||
 | 
			
		||||
            result = self.client_get('/new-user/')
 | 
			
		||||
 
 | 
			
		||||
@@ -1,54 +1,60 @@
 | 
			
		||||
#!/usr/bin/env python
 | 
			
		||||
from __future__ import absolute_import
 | 
			
		||||
from __future__ import print_function
 | 
			
		||||
import os
 | 
			
		||||
from typing import List, Dict, Any
 | 
			
		||||
 | 
			
		||||
from django.conf import settings
 | 
			
		||||
from django.http import HttpRequest, HttpResponse
 | 
			
		||||
from django.shortcuts import render
 | 
			
		||||
from django.template import loader, TemplateDoesNotExist
 | 
			
		||||
 | 
			
		||||
from zerver.models import get_realm
 | 
			
		||||
 | 
			
		||||
import os
 | 
			
		||||
from typing import List, Dict, Any
 | 
			
		||||
 | 
			
		||||
ZULIP_PATH = os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../')
 | 
			
		||||
 | 
			
		||||
def email_page(request):
 | 
			
		||||
    # type: (HttpRequest) -> HttpResponse
 | 
			
		||||
    # write fake data for all variables
 | 
			
		||||
    realm = get_realm('zulip')
 | 
			
		||||
    test_context = {
 | 
			
		||||
        'user_profile': {
 | 
			
		||||
            'full_name': 'Zooly Zulipson',
 | 
			
		||||
            'email': 'zooly@zulip.org',
 | 
			
		||||
            'full_name': 'Wile E. Coyote',
 | 
			
		||||
            'email': 'coyote@acme.com',
 | 
			
		||||
            'realm': {
 | 
			
		||||
                'uri': 'https://chat.zulip.org',
 | 
			
		||||
                'name': 'Zulip Community',
 | 
			
		||||
                'uri': realm.uri,
 | 
			
		||||
                'name': 'Acme Corporation',
 | 
			
		||||
            },
 | 
			
		||||
        },
 | 
			
		||||
        'realm': {
 | 
			
		||||
            'uri': 'https://chat.zulip.org',
 | 
			
		||||
            'name': 'Zulip Community',
 | 
			
		||||
            'uri': realm.uri,
 | 
			
		||||
            'name': 'Acme Corporation',
 | 
			
		||||
        },
 | 
			
		||||
        'device_info': {
 | 
			
		||||
            'login_time': "12/12/12, 12:12:12",
 | 
			
		||||
            'device_browser': "Firefox",
 | 
			
		||||
            'device_os': "ZulipOS",
 | 
			
		||||
            'device_ip': '127.0.0.1',
 | 
			
		||||
            'device_ip': '3.14.15.92',
 | 
			
		||||
        },
 | 
			
		||||
        'referrer': {
 | 
			
		||||
            'full_name': 'Zooly Zulipson',
 | 
			
		||||
            'email': 'zooly@zulip.org',
 | 
			
		||||
            'full_name': 'Road Runner',
 | 
			
		||||
            'email': 'runner@acme.com',
 | 
			
		||||
        },
 | 
			
		||||
        'user': {
 | 
			
		||||
            'full_name': 'Zooly Zulipson',
 | 
			
		||||
            'email': 'zooly@zulip.org',
 | 
			
		||||
            'full_name': 'Wile E. Coyote',
 | 
			
		||||
            'email': 'coyote@acme.com',
 | 
			
		||||
        },
 | 
			
		||||
        'referrer_name': 'Zooly Zulipson',
 | 
			
		||||
        'referrer_email': 'Zooly Zulipson',
 | 
			
		||||
        'realm_uri': 'https://chat.zulip.org',
 | 
			
		||||
        'server_uri': 'https://chat.zulip.org',
 | 
			
		||||
        'old_email': 'oldmail@zulip.org',
 | 
			
		||||
        'new_email': 'newmail@zulip.org',
 | 
			
		||||
        'activate_url': 'https://test.zulip.org',
 | 
			
		||||
        'support_email': 'admin@zulip.org',
 | 
			
		||||
        'zulip_support': 'admin@zulip.org',
 | 
			
		||||
        'unsubscribe_link': 'https://unsub.zulip.org',
 | 
			
		||||
        'referrer_name': 'Road Runner',
 | 
			
		||||
        'referrer_email': 'runner@acme.com',
 | 
			
		||||
        'realm_uri': realm.uri,
 | 
			
		||||
        'server_uri': settings.SERVER_URI,
 | 
			
		||||
        'old_email': 'old_address@acme.com',
 | 
			
		||||
        'new_email': 'new_address@acme.com',
 | 
			
		||||
        'activate_url': '%s/accounts/do_confirm/5348720e4af7d2e8f296cbbd04d439489917ddc0' % (settings.SERVER_URI,),
 | 
			
		||||
        'support_email': 'support@' + settings.EXTERNAL_HOST,
 | 
			
		||||
        'zulip_support': 'support@' + settings.EXTERNAL_HOST,
 | 
			
		||||
        'unsubscribe_link': '%s/accounts/unsubscribe/<type>/cf88931365ef1b0f12eae8d488bbc7af3563d7f0' % (settings.SERVER_URI,),
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    # Do not render these templates,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user