Projet

Général

Profil

0001-pwa-allow-custom-title-32371.patch

Serghei Mihai (congés, retour 15/05), 16 avril 2019 13:19

Télécharger (1,67 ko)

Voir les différences:

Subject: [PATCH] pwa: allow custom title (#32371)

 combo/apps/pwa/templates/combo/manifest.json | 4 ++--
 tests/test_pwa.py                            | 3 +++
 2 files changed, 5 insertions(+), 2 deletions(-)
combo/apps/pwa/templates/combo/manifest.json
1 1
{% load static thumbnail %}{
2
    "name": "{% firstof global_title "Compte Citoyen" %}",
3
    "short_name": "{% firstof global_title "Compte Citoyen" %}",
2
    "name": "{% firstof pwa_title global_title "Compte Citoyen" %}",
3
    "short_name": "{% firstof pwa_title global_title "Compte Citoyen" %}",
4 4
    "start_url": "{% firstof pwa_start_url "/" %}",
5 5
    {% if theme_color %}
6 6
    "background_color": "{{ theme_color }}",
tests/test_pwa.py
32 32
    with override_settings(TEMPLATE_VARS={'global_title': 'FooBar'}):
33 33
        assert app.get('/manifest.json', status=200).json['name'] == 'FooBar'
34 34

  
35
    with override_settings(TEMPLATE_VARS={'pwa_title': 'CustomTitle', 'global_title': 'FooBar'}):
36
        assert app.get('/manifest.json', status=200).json['name'] == 'CustomTitle'
37

  
35 38
def test_service_worker(app):
36 39
    app.get('/service-worker.js', status=200)
37 40
    app.get('/service-worker-registration.js', status=200)
38
-