-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,9 @@ def __init__(self, ban_expiry, ban_reason, *args, **kwargs): | |
def message(self): | ||
return ( | ||
f"You are banned from FAF {self._ban_duration_text()}. <br>" | ||
f"Reason: <br>{self.ban_reason}" | ||
f"Reason: <br>{self.ban_reason}<br><br>" | ||
"<i>If you would like to appeal this ban, please send an email to: " | ||
"[email protected]</i>" | ||
) | ||
|
||
def _ban_duration_text(self): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,11 @@ async def test_server_ban(lobby_server, user): | |
assert msg == { | ||
"command": "notice", | ||
"style": "error", | ||
"text": "You are banned from FAF forever. <br>Reason: <br>Test permanent ban" | ||
"text": ( | ||
"You are banned from FAF forever. <br>Reason: <br>Test permanent ban" | ||
"<br><br><i>If you would like to appeal this ban, please send an " | ||
"email to: [email protected]</i>" | ||
) | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -793,7 +793,11 @@ async def test_server_ban_prevents_hosting(lobby_server, database, command): | |
assert msg == { | ||
"command": "notice", | ||
"style": "error", | ||
"text": "You are banned from FAF forever. <br>Reason: <br>Test live ban" | ||
"text": ( | ||
"You are banned from FAF forever. <br>Reason: <br>Test live ban<br>" | ||
"<br><i>If you would like to appeal this ban, please send an email " | ||
"to: [email protected]</i>" | ||
) | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1076,8 +1076,11 @@ async def test_abort_connection_if_banned( | |
lobbyconnection.player.id = 203 | ||
with pytest.raises(BanError) as banned_error: | ||
await lobbyconnection.abort_connection_if_banned() | ||
assert banned_error.value.message() == \ | ||
assert banned_error.value.message() == ( | ||
"You are banned from FAF forever. <br>Reason: <br>Test permanent ban" | ||
"<br><br><i>If you would like to appeal this ban, please send an email " | ||
"to: [email protected]</i>" | ||
) | ||
|
||
# test user who is banned for another 46 hours | ||
lobbyconnection.player.id = 204 | ||
|