Skip to content

Update tests to ensure that infractions sent to the DB are NOT truncated (even if so on Discord's side) #2955

Closed
@ichard26

Description

@ichard26

Moving this below

        if reason:
            reason = textwrap.shorten(reason, width=512, placeholder="...")

causes a change in behaviour.

I assume the behaviour we want is for the full message to be sent to the database, but the reason to be trimmed in the audit log (I assume because there's a limit there), but now it's also trimmed in the database.

Originally posted by @wookie184 in #2316 (comment)


We should modify the tests to catch this too

class TruncationTests(unittest.IsolatedAsyncioTestCase):

You can do that here if you want otherwise I can open an issue for it.

Metadata

Metadata

Assignees

Labels

a: testsRelated to tests (e.g. unit tests)p: 3 - lowLow Prioritys: planningDiscussing detailst: enhancementChanges or improvements to existing features

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions