summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHarshit Bansal2016-02-23 00:26:15 +0530
committerBarry Warsaw2016-03-03 18:41:29 -0500
commit762049d06bdac3d399a7ff92d49a567c5f6cd6ad (patch)
treec4f44164a6f5f83852cb4c8165e64ef94569303e /src
parentb91abf9a0f8db18e341cbbe83c4a20a60efd83d6 (diff)
downloadmailman-762049d06bdac3d399a7ff92d49a567c5f6cd6ad.tar.gz
mailman-762049d06bdac3d399a7ff92d49a567c5f6cd6ad.tar.zst
mailman-762049d06bdac3d399a7ff92d49a567c5f6cd6ad.zip
Diffstat (limited to 'src')
-rw-r--r--src/mailman/rest/docs/listconf.rst2
-rw-r--r--src/mailman/rest/listconf.py1
-rw-r--r--src/mailman/rest/tests/test_listconf.py37
3 files changed, 40 insertions, 0 deletions
diff --git a/src/mailman/rest/docs/listconf.rst b/src/mailman/rest/docs/listconf.rst
index 8b65f58f0..dc815e725 100644
--- a/src/mailman/rest/docs/listconf.rst
+++ b/src/mailman/rest/docs/listconf.rst
@@ -45,6 +45,7 @@ All readable attributes for a list are available on a sub-resource.
filter_content: False
first_strip_reply_to: False
fqdn_listname: ant@example.com
+ goodbye_message_uri:
http_etag: "..."
include_rfc2369_headers: True
join_address: ant-join@example.com
@@ -107,6 +108,7 @@ When using ``PUT``, all writable attributes must be included.
... posting_pipeline='virgin',
... filter_content=True,
... first_strip_reply_to=True,
+ ... goodbye_message_uri='mailman:///anotherfile.txt',
... convert_html_to_plaintext=True,
... collapse_alternatives=False,
... reply_goes_to_list='point_to_list',
diff --git a/src/mailman/rest/listconf.py b/src/mailman/rest/listconf.py
index 2a440dca0..6eb88e1fd 100644
--- a/src/mailman/rest/listconf.py
+++ b/src/mailman/rest/listconf.py
@@ -119,6 +119,7 @@ ATTRIBUTES = dict(
digests_enabled=GetterSetter(as_boolean),
filter_content=GetterSetter(as_boolean),
first_strip_reply_to=GetterSetter(as_boolean),
+ goodbye_message_uri=GetterSetter(str),
fqdn_listname=GetterSetter(None),
mail_host=GetterSetter(None),
allow_list_posts=GetterSetter(as_boolean),
diff --git a/src/mailman/rest/tests/test_listconf.py b/src/mailman/rest/tests/test_listconf.py
index 7f8a91e74..8f437f65d 100644
--- a/src/mailman/rest/tests/test_listconf.py
+++ b/src/mailman/rest/tests/test_listconf.py
@@ -76,6 +76,7 @@ RESOURCE = dict(
welcome_message_uri='mailman:///welcome.txt',
default_member_action='hold',
default_nonmember_action='discard',
+ goodbye_message_uri='mailman:///somefile.txt',
)
@@ -375,3 +376,39 @@ class TestConfiguration(unittest.TestCase):
'PUT')
self.assertEqual(response.status, 204)
self.assertTrue(self._mlist.digests_enabled)
+
+ def test_get_goodbye_message_uri(self):
+ with transaction():
+ self._mlist.goodbye_message_uri = 'mailman:///somefile.txt'
+ resource, response = call_api(
+ 'http://localhost:9001/3.0/lists/ant.example.com/config'
+ '/goodbye_message_uri')
+ self.assertEqual(resource['goodbye_message_uri'], 'mailman:///somefile.txt')
+
+ def test_patch_goodbye_message_uri(self):
+ with transaction():
+ self._mlist.goodbye_message_uri = 'mailman:///somefile.txt'
+ resource, response = call_api(
+ 'http://localhost:9001/3.0/lists/ant.example.com/config'
+ '/goodbye_message_uri',
+ dict(goodbye_message_uri='mailman:///anotherfile.txt'),
+ 'PATCH')
+ self.assertEqual(response.status, 204)
+ resource, response = call_api(
+ 'http://localhost:9001/3.0/lists/ant.example.com/config'
+ '/goodbye_message_uri')
+ self.assertEqual(resource['goodbye_message_uri'], 'mailman:///anotherfile.txt')
+
+ def test_put_goodbye_message_uri(self):
+ with transaction():
+ self._mlist.goodbye_message_uri = 'mailman:///somefile.txt'
+ resource, response = call_api(
+ 'http://localhost:9001/3.0/lists/ant.example.com/config'
+ '/goodbye_message_uri',
+ dict(goodbye_message_uri='mailman:///anotherfile.txt'),
+ 'PUT')
+ self.assertEqual(response.status, 204)
+ resource, response = call_api(
+ 'http://localhost:9001/3.0/lists/ant.example.com/config'
+ '/goodbye_message_uri')
+ self.assertEqual(resource['goodbye_message_uri'], 'mailman:///anotherfile.txt')