aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/helpers.py')
-rw-r--r--tests/helpers.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/helpers.py b/tests/helpers.py
index b5a3f2463..b7e5cc871 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -256,6 +256,9 @@ class MockMember(CustomMockMixin, unittest.mock.Mock, ColourMixin, HashableMixin
if "mention" not in kwargs:
self.mention = f"@{self.name}"
+ def get_role(self, role_id: int) -> MockRole | None:
+ return discord.utils.get(self.roles, id=role_id)
+
# Create a User instance to get a realistic Mock of `discord.User`
_user_data_mock = collections.defaultdict(unittest.mock.MagicMock, {