Fixed #32132 -- Fixed column types in m2m intermediary tables for Positive(Big/Small)IntegerFields.

This commit is contained in:
David-Wobrock 2020-10-23 23:56:12 +02:00 committed by Mariusz Felisiak
parent 4ebd633350
commit cfc7cd6513
2 changed files with 31 additions and 10 deletions

View file

@ -176,6 +176,11 @@ class BigIntegerFieldTests(IntegerFieldTests):
class PositiveSmallIntegerFieldTests(IntegerFieldTests):
model = PositiveSmallIntegerModel
documented_range = (0, 32767)
rel_db_type_class = (
models.PositiveSmallIntegerField
if connection.features.related_fields_match_type
else models.SmallIntegerField
)
class PositiveIntegerFieldTests(IntegerFieldTests):
@ -198,6 +203,11 @@ class PositiveIntegerFieldTests(IntegerFieldTests):
class PositiveBigIntegerFieldTests(IntegerFieldTests):
model = PositiveBigIntegerModel
documented_range = (0, 9223372036854775807)
rel_db_type_class = (
models.PositiveBigIntegerField
if connection.features.related_fields_match_type
else models.BigIntegerField
)
class ValidationTests(SimpleTestCase):