Skip to content

Overflow regression - #10041

Open
auvipy wants to merge 2 commits into
encode:mainfrom
jamescooke:overflow-regression
Open

auvipy wants to merge 2 commits into
encode:mainfrom
jamescooke:overflow-regression

Conversation

@auvipy

@auvipy auvipy commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Adding a regression test to cover a crash that was reported a while back which has been fixed by another change in the meantime.

Closes #7134

@auvipy

auvipy commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator Author

@jamescooke i reopened this from your branch to verify

@jamescooke

Copy link
Copy Markdown
Contributor

Thanks @auvipy - it'd be super nice to get this closed off 馃檹馃徎

])


class Issue7314Test(TestCase):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
class Issue7314Test(TestCase):
class Issue7134Test(TestCase):

Comment on lines +1529 to +1530
with self.assertRaises(serializers.ValidationError):
serializer.is_valid(raise_exception=True)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
with self.assertRaises(serializers.ValidationError):
serializer.is_valid(raise_exception=True)
with self.assertRaises(serializers.ValidationError) as ctx:
serializer.is_valid(raise_exception=True)
# Check that the error code of the validation error
self.assertEqual(
[error.code for error in ctx.exception.detail['value']],
['max_value'],
)

@browniebroke browniebroke left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to get this added yes. Noticed that the issue number is wrong and the assert on the validation error could be made a bit more specific. Suggestion added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

ModelSerializer uniqueness check crashes with OverflowError and that crash can not be prevented with field-level validation

3 participants