diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bot/exts/filtering/test_settings_entries.py | 8 | ||||
-rw-r--r-- | tests/helpers.py | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/tests/bot/exts/filtering/test_settings_entries.py b/tests/bot/exts/filtering/test_settings_entries.py index 4db6438ab..d18861bd6 100644 --- a/tests/bot/exts/filtering/test_settings_entries.py +++ b/tests/bot/exts/filtering/test_settings_entries.py @@ -62,7 +62,7 @@ class FilterTests(unittest.TestCase): def test_context_doesnt_trigger_for_disabled_channel(self): """A filter shouldn't trigger if it's been disabled in the channel.""" channel = MockTextChannel(id=123) - scope = ChannelScope({"disabled_channels": [123], "disabled_categories": None, "enabled_channels": None}) + scope = ChannelScope({"disabled_channels": ["123"], "disabled_categories": None, "enabled_channels": None}) self.ctx.channel = channel result = scope.triggers_on(self.ctx) @@ -71,9 +71,9 @@ class FilterTests(unittest.TestCase): def test_context_doesnt_trigger_in_disabled_category(self): """A filter shouldn't trigger if it's been disabled in the category.""" - channel = MockTextChannel() + channel = MockTextChannel(category=MockCategoryChannel(id=456)) scope = ChannelScope({ - "disabled_channels": None, "disabled_categories": [channel.category.id], "enabled_channels": None + "disabled_channels": None, "disabled_categories": ["456"], "enabled_channels": None }) self.ctx.channel = channel @@ -84,7 +84,7 @@ class FilterTests(unittest.TestCase): def test_context_triggers_in_enabled_channel_in_disabled_category(self): """A filter should trigger in an enabled channel even if it's been disabled in the category.""" channel = MockTextChannel(id=123, category=MockCategoryChannel(id=234)) - scope = ChannelScope({"disabled_channels": None, "disabled_categories": [234], "enabled_channels": [123]}) + scope = ChannelScope({"disabled_channels": None, "disabled_categories": ["234"], "enabled_channels": ["123"]}) self.ctx.channel = channel result = scope.triggers_on(self.ctx) diff --git a/tests/helpers.py b/tests/helpers.py index 17214553c..e74306d23 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -423,7 +423,7 @@ category_channel_instance = discord.CategoryChannel( class MockCategoryChannel(CustomMockMixin, unittest.mock.Mock, HashableMixin): def __init__(self, **kwargs) -> None: default_kwargs = {'id': next(self.discord_id)} - super().__init__(**collections.ChainMap(default_kwargs, kwargs)) + super().__init__(**collections.ChainMap(kwargs, default_kwargs)) # Create a Message instance to get a realistic MagicMock of `discord.Message` |