Mark Sapiro pushed to branch master at GNU Mailman / Mailman Core


Commits:
76bd8b6a by Pierre Gay at 2020-11-27T13:50:12+01:00
expose list config send_goodbye_message through REST

- - - - -
9b36ab61 by Pierre Gay at 2020-11-27T20:08:54+01:00
add NEWS.rst note

- - - - -
ab4390b3 by Mark Sapiro at 2020-11-28T00:52:00+00:00
Merge branch 'rest_listconfig_send_goodbye_message' into 
'master'

expose list config send_goodbye_message through REST

See merge request mailman/mailman!737
- - - - -


5 changed files:

- src/mailman/docs/NEWS.rst
- src/mailman/rest/docs/listconf.rst
- src/mailman/rest/listconf.py
- src/mailman/rest/tests/test_listconf.py
- src/mailman/rest/tests/test_lists.py


Changes:

=====================================
src/mailman/docs/NEWS.rst
=====================================
@@ -28,6 +28,11 @@ New Features
   mailman.cfg.  If this is set to ``yes``, posts with a digest like Subject:
   header or which quote the digest masthead will be held for moderation.
 
+REST
+----
+* List configuration option ``send_goodbye_message`` is now exposed through
+  the REST API. (See !737)
+
 3.3.2
 =====
 


=====================================
src/mailman/rest/docs/listconf.rst
=====================================
@@ -108,6 +108,7 @@ All readable attributes for a list are available on a 
sub-resource.
     request_address: ant-requ...@example.com
     require_explicit_destination: True
     respond_to_post_requests: True
+    send_goodbye_message: True
     send_welcome_message: True
     subject_prefix: [Ant]
     subscription_policy: confirm
@@ -187,6 +188,7 @@ When using ``PUT``, all writable attributes must be 
included.
     ...             reply_to_address='b...@example.com',
     ...             require_explicit_destination=False,
     ...             member_roster_visibility='members',
+    ...             send_goodbye_message=False,
     ...             send_welcome_message=False,
     ...             subject_prefix='[ant]',
     ...             subscription_policy='moderate',
@@ -287,6 +289,7 @@ These values are changed permanently.
     ...
     require_explicit_destination: False
     respond_to_post_requests: True
+    send_goodbye_message: False
     send_welcome_message: False
     subject_prefix: [ant]
     subscription_policy: moderate


=====================================
src/mailman/rest/listconf.py
=====================================
@@ -233,6 +233,7 @@ ATTRIBUTES = dict(
     request_address=GetterSetter(None),
     require_explicit_destination=GetterSetter(as_boolean),
     respond_to_post_requests=GetterSetter(as_boolean),
+    send_goodbye_message=GetterSetter(as_boolean),
     send_welcome_message=GetterSetter(as_boolean),
     subject_prefix=GetterSetter(str),
     subscription_policy=GetterSetter(enum_validator(SubscriptionPolicy)),


=====================================
src/mailman/rest/tests/test_listconf.py
=====================================
@@ -112,6 +112,7 @@ RESOURCE = dict(
     reply_to_address='b...@example.com',
     require_explicit_destination=True,
     member_roster_visibility='public',
+    send_goodbye_message=False,
     send_welcome_message=False,
     subject_prefix='[ant]',
     subscription_policy='confirm_then_moderate',
@@ -518,6 +519,28 @@ class TestConfiguration(unittest.TestCase):
                 'PATCH')
             self.assertEqual(self._mlist.info, '')
 
+    def test_patch_send_welcome_message(self):
+        with transaction():
+            self._mlist.send_welcome_message = False
+        resource, response = call_api(
+            'http://localhost:9001/3.0/lists/ant.example.com/config'
+            '/send_welcome_message',
+            dict(send_welcome_message=True),
+            'PATCH')
+        self.assertEqual(response.status_code, 204)
+        self.assertTrue(self._mlist.send_welcome_message)
+
+    def test_patch_send_goodbye_message(self):
+        with transaction():
+            self._mlist.send_goodbye_message = False
+        resource, response = call_api(
+            'http://localhost:9001/3.0/lists/ant.example.com/config'
+            '/send_goodbye_message',
+            dict(send_goodbye_message=True),
+            'PATCH')
+        self.assertEqual(response.status_code, 204)
+        self.assertTrue(self._mlist.send_goodbye_message)
+
     def test_delete_top_level_listconf(self):
         with self.assertRaises(HTTPError) as cm:
             call_api('http://localhost:9001/3.0/lists/ant.example.com/config',


=====================================
src/mailman/rest/tests/test_lists.py
=====================================
@@ -634,6 +634,7 @@ class TestListDigests(unittest.TestCase):
     def setUp(self):
         with transaction():
             self._mlist = create_list('a...@example.com')
+            self._mlist.send_goodbye_message = False
             self._mlist.send_welcome_message = False
             anne = getUtility(IUserManager).create_address('a...@example.com')
             self._mlist.subscribe(anne)



View it on GitLab: 
https://gitlab.com/mailman/mailman/-/compare/40658fc57a8557363968a21568d03949a8c3fc92...ab4390b357b7a0107aa1df0486e69627bc656f35

-- 
View it on GitLab: 
https://gitlab.com/mailman/mailman/-/compare/40658fc57a8557363968a21568d03949a8c3fc92...ab4390b357b7a0107aa1df0486e69627bc656f35
You're receiving this email because of your account on gitlab.com.


_______________________________________________
Mailman-checkins mailing list -- mailman-checkins@python.org
To unsubscribe send an email to mailman-checkins-le...@python.org
https://mail.python.org/mailman3/lists/mailman-checkins.python.org/
Member address: arch...@jab.org

Reply via email to