0001-sms-display-SMS-connector-fields-45817.patch
passerelle/sms/templates/passerelle/manage/messages_service_view.html | ||
---|---|---|
1 | 1 |
{% extends "passerelle/manage/service_view.html" %} |
2 | 2 |
{% load i18n passerelle %} |
3 | 3 | |
4 |
{% block description %} |
|
5 |
{% if object.description %}{{object.description|linebreaks}}{% endif %} |
|
6 |
{% endblock %} |
|
7 | ||
8 | 4 |
{% block endpoints %} |
9 | 5 |
<ul> |
10 | 6 |
<li>{% trans 'Sending a message:' %} <a href="send" >{{ site_base_uri }}{{ object.get_absolute_url }}send</a> (POST)</li> |
11 | 7 |
</ul> |
12 | 8 |
{% endblock %} |
tests/test_sms.py | ||
---|---|---|
97 | 97 | |
98 | 98 |
def test_manage_views(admin_user, app, connector): |
99 | 99 |
url = '/%s/%s/' % (connector.get_connector_slug(), connector.slug) |
100 | 100 |
resp = app.get(url) |
101 | 101 |
assert 'Endpoints' in resp.text |
102 | 102 |
assert not 'accessright/add' in resp.text |
103 | 103 |
app = login(app) |
104 | 104 |
resp = app.get(url) |
105 |
description_fields = [x.text.split(':')[0] for x in resp.html.find('div', {'id': 'description'}).find_all('p')] |
|
106 |
assert 'Default country code' in description_fields |
|
107 |
assert 'Default trunk prefix' in description_fields |
|
108 |
assert 'Maximum message length' in description_fields |
|
109 |
assert 'Account' not in description_fields |
|
110 |
assert 'Username' not in description_fields |
|
105 | 111 |
assert 'Endpoints' in resp.text |
106 | 112 |
assert 'accessright/add' in resp.text |
107 | 113 | |
108 | 114 | |
109 | 115 |
@pytest.mark.parametrize('connector', [OVHSMSGateway], indirect=True) |
110 | 116 |
def test_sms_max_message_length(app, connector): |
111 | 117 |
path = '/%s/%s/send/' % (connector.get_connector_slug(), connector.slug) |
112 | 118 | |
113 |
- |