diff options
| author | 2021-08-16 14:26:14 +0530 | |
|---|---|---|
| committer | 2021-10-11 12:05:45 +0530 | |
| commit | 43bed60ff788eefba704318f8b18e0b3f8b5eb4c (patch) | |
| tree | e4a2cf1a5a477778e131990ec3bbe8e4e6de7586 /tests | |
| parent | Update tests for message link embeds (diff) | |
Mock id,content attribute rather than type casting
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/bot/exts/moderation/test_incidents.py | 7 | 
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/bot/exts/moderation/test_incidents.py b/tests/bot/exts/moderation/test_incidents.py index 6e97d31af..06eafdde3 100644 --- a/tests/bot/exts/moderation/test_incidents.py +++ b/tests/bot/exts/moderation/test_incidents.py @@ -853,11 +853,12 @@ class TestMessageLinkEmbeds(TestIncidents):      @patch("bot.exts.moderation.incidents.is_incident", MagicMock(return_value=True))      async def test_incident_message_edit(self):          """Edit the incident message and check whether `extract_message_links` is called or not.""" -        self.cog_instance.incidents_webhook = MockAsyncWebhook()  # Patch in our webhook +        self.cog_instance.incidents_webhook = MockAsyncWebhook(id=101)  # Patch in our webhook +        self.cog_instance.incidents_webhook.send = AsyncMock(return_value=MockMessage(id=191)) -        text_channel = MockTextChannel() +        text_channel = MockTextChannel(id=123)          self.cog_instance.bot.get_channel = MagicMock(return_value=text_channel) -        text_channel.fetch_message = AsyncMock(return_value=MockMessage()) +        text_channel.fetch_message = AsyncMock(return_value=MockMessage(id=777, content="Did jason just screw up?"))          payload = AsyncMock(              discord.RawMessageUpdateEvent,  |