aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorGravatar Sebastiaan Zeeff <[email protected]>2020-03-30 13:36:34 +0200
committerGravatar Sebastiaan Zeeff <[email protected]>2020-03-30 13:36:34 +0200
commit582ddbb1ca8bab2cb883781911f5f35962330995 (patch)
tree9eeda53b7ae0fbc0efc11d676ae95ac3c6fc33d7 /tests
parentMerge pull request #812 from Numerlor/hush-cog (diff)
Set unsilence permissions to inherit instead of true
The "unsilence" action of the silence/hush command used `send_messages=True` when unsilencing a hushed channel. This had the side effect of also enabling send messages permissions for those with the Muted rule, as an explicit True permission apparently overwrites an explicit False permission, even if the latter was set for a higher top-role. The solution is to revert back to the `Inherit` permission by assigning `None`. This is what we normally use when Developers are allowed to send messages to a channel.
Diffstat (limited to 'tests')
-rw-r--r--tests/bot/cogs/moderation/test_silence.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/bot/cogs/moderation/test_silence.py b/tests/bot/cogs/moderation/test_silence.py
index 44682a1bd..3fd149f04 100644
--- a/tests/bot/cogs/moderation/test_silence.py
+++ b/tests/bot/cogs/moderation/test_silence.py
@@ -194,7 +194,7 @@ class SilenceTests(unittest.IsolatedAsyncioTestCase):
channel = MockTextChannel(overwrites_for=Mock(return_value=perm_overwrite))
self.assertTrue(await self.cog._unsilence(channel))
channel.set_permissions.assert_called_once()
- self.assertTrue(channel.set_permissions.call_args.kwargs['send_messages'])
+ self.assertIsNone(channel.set_permissions.call_args.kwargs['send_messages'])
@mock.patch.object(Silence, "notifier", create=True)
async def test_unsilence_private_removed_notifier(self, notifier):