aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py
diff options
context:
space:
mode:
authorGravatar Johannes Christ <[email protected]>2021-10-05 23:59:05 +0200
committerGravatar GitHub <[email protected]>2021-10-05 23:59:05 +0200
commit8ec45933b8eb78b0aae757d4a8691add8f1c064a (patch)
tree39868b2a6e05d82cf6385fa42c80599e7fb38031 /tests/helpers.py
parentMerge pull request #1806 from python-discord/infract-then-dm (diff)
parentMerge branch 'main' into ignore-infra-mods-errors (diff)
Merge pull request #1798 from python-discord/ignore-infra-mods-errors
Prevent role hierarchy issues with infractions
Diffstat (limited to 'tests/helpers.py')
-rw-r--r--tests/helpers.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/helpers.py b/tests/helpers.py
index 47f06f292..83b9b2363 100644
--- a/tests/helpers.py
+++ b/tests/helpers.py
@@ -235,6 +235,7 @@ class MockMember(CustomMockMixin, unittest.mock.Mock, ColourMixin, HashableMixin
self.roles = [MockRole(name="@everyone", position=1, id=0)]
if roles:
self.roles.extend(roles)
+ self.top_role = max(self.roles)
if 'mention' not in kwargs:
self.mention = f"@{self.name}"
@@ -442,6 +443,7 @@ class MockContext(CustomMockMixin, unittest.mock.MagicMock):
def __init__(self, **kwargs) -> None:
super().__init__(**kwargs)
+ self.me = kwargs.get('me', MockMember())
self.bot = kwargs.get('bot', MockBot())
self.guild = kwargs.get('guild', MockGuild())
self.author = kwargs.get('author', MockMember())